|
@@ -2,11 +2,10 @@ package com.yoho.search.service.scene.others.tbl; |
|
@@ -2,11 +2,10 @@ package com.yoho.search.service.scene.others.tbl; |
2
|
|
2
|
|
3
|
import com.alibaba.fastjson.JSONObject;
|
3
|
import com.alibaba.fastjson.JSONObject;
|
4
|
import com.yoho.search.base.utils.ISearchConstants;
|
4
|
import com.yoho.search.base.utils.ISearchConstants;
|
|
|
5
|
+import com.yoho.search.common.SearchCommonService;
|
5
|
import com.yoho.search.core.es.model.SearchParam;
|
6
|
import com.yoho.search.core.es.model.SearchParam;
|
6
|
import com.yoho.search.core.es.model.SearchResult;
|
7
|
import com.yoho.search.core.es.model.SearchResult;
|
7
|
import com.yoho.search.models.SearchApiResult;
|
8
|
import com.yoho.search.models.SearchApiResult;
|
8
|
-import com.yoho.search.common.SearchCommonService;
|
|
|
9
|
-import com.yoho.search.common.SearchDynamicConfigService;
|
|
|
10
|
import org.apache.commons.lang.StringUtils;
|
9
|
import org.apache.commons.lang.StringUtils;
|
11
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
10
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
12
|
import org.elasticsearch.index.query.QueryBuilders;
|
11
|
import org.elasticsearch.index.query.QueryBuilders;
|
|
@@ -34,8 +33,6 @@ public class TblProductService { |
|
@@ -34,8 +33,6 @@ public class TblProductService { |
34
|
private SearchCommonService searchCommonService;
|
33
|
private SearchCommonService searchCommonService;
|
35
|
@Autowired
|
34
|
@Autowired
|
36
|
private TblProductServiceHepler tblProductServiceHepler;
|
35
|
private TblProductServiceHepler tblProductServiceHepler;
|
37
|
- @Autowired
|
|
|
38
|
- private SearchDynamicConfigService searchDynamicConfigService;
|
|
|
39
|
|
36
|
|
40
|
public SearchApiResult search(Map<String, String> paramMap) throws Exception {
|
37
|
public SearchApiResult search(Map<String, String> paramMap) throws Exception {
|
41
|
|
38
|
|
|
@@ -75,17 +72,8 @@ public class TblProductService { |
|
@@ -75,17 +72,8 @@ public class TblProductService { |
75
|
// 4、增加aggregation
|
72
|
// 4、增加aggregation
|
76
|
searchParam.setAggregationBuilders(tblProductServiceHepler.buildAggregations(paramMap));
|
73
|
searchParam.setAggregationBuilders(tblProductServiceHepler.buildAggregations(paramMap));
|
77
|
|
74
|
|
78
|
-
|
|
|
79
|
- boolean tblUseNewIndex = searchDynamicConfigService.tblUseNewIndex();
|
|
|
80
|
- SearchResult searchResult;
|
|
|
81
|
- if (tblUseNewIndex) {
|
|
|
82
|
- searchResult = searchCommonService.doSearch(ISearchConstants.INDEX_NAME_TBLPRODUCT_NEW, searchParam);
|
|
|
83
|
- } else {
|
|
|
84
|
- searchResult = searchCommonService.doSearch(ISearchConstants.INDEX_NAME_TBLPRODUCT, searchParam);
|
|
|
85
|
- }
|
|
|
86
|
-
|
|
|
87
|
// 5、执行搜索
|
75
|
// 5、执行搜索
|
88
|
-
|
76
|
+ SearchResult searchResult = searchCommonService.doSearch(ISearchConstants.INDEX_NAME_TBLPRODUCT_NEW, searchParam);
|
89
|
|
77
|
|
90
|
// 6、构造返回结果
|
78
|
// 6、构造返回结果
|
91
|
JSONObject dataMap = new JSONObject();
|
79
|
JSONObject dataMap = new JSONObject();
|