...
|
...
|
@@ -2,11 +2,10 @@ package com.yoho.search.service.scene.others.tbl; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.search.base.utils.ISearchConstants;
|
|
|
import com.yoho.search.common.SearchCommonService;
|
|
|
import com.yoho.search.core.es.model.SearchParam;
|
|
|
import com.yoho.search.core.es.model.SearchResult;
|
|
|
import com.yoho.search.models.SearchApiResult;
|
|
|
import com.yoho.search.common.SearchCommonService;
|
|
|
import com.yoho.search.common.SearchDynamicConfigService;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilders;
|
...
|
...
|
@@ -34,8 +33,6 @@ public class TblProductService { |
|
|
private SearchCommonService searchCommonService;
|
|
|
@Autowired
|
|
|
private TblProductServiceHepler tblProductServiceHepler;
|
|
|
@Autowired
|
|
|
private SearchDynamicConfigService searchDynamicConfigService;
|
|
|
|
|
|
public SearchApiResult search(Map<String, String> paramMap) throws Exception {
|
|
|
|
...
|
...
|
@@ -75,17 +72,8 @@ public class TblProductService { |
|
|
// 4、增加aggregation
|
|
|
searchParam.setAggregationBuilders(tblProductServiceHepler.buildAggregations(paramMap));
|
|
|
|
|
|
|
|
|
boolean tblUseNewIndex = searchDynamicConfigService.tblUseNewIndex();
|
|
|
SearchResult searchResult;
|
|
|
if (tblUseNewIndex) {
|
|
|
searchResult = searchCommonService.doSearch(ISearchConstants.INDEX_NAME_TBLPRODUCT_NEW, searchParam);
|
|
|
} else {
|
|
|
searchResult = searchCommonService.doSearch(ISearchConstants.INDEX_NAME_TBLPRODUCT, searchParam);
|
|
|
}
|
|
|
|
|
|
// 5、执行搜索
|
|
|
|
|
|
SearchResult searchResult = searchCommonService.doSearch(ISearchConstants.INDEX_NAME_TBLPRODUCT_NEW, searchParam);
|
|
|
|
|
|
// 6、构造返回结果
|
|
|
JSONObject dataMap = new JSONObject();
|
...
|
...
|
|