...
|
...
|
@@ -47,8 +47,8 @@ import com.yoho.search.core.es.model.SearchParam; |
|
|
import com.yoho.search.core.es.model.SearchResult;
|
|
|
import com.yoho.search.core.es.utils.IgnoreSomeException;
|
|
|
import com.yoho.search.service.aggregations.impls.AggregationFactoryService;
|
|
|
import com.yoho.search.service.cache.SearchCacheMatchLogger;
|
|
|
import com.yoho.search.service.cache.SearchCacheFactory;
|
|
|
import com.yoho.search.service.cache.SearchCacheMatchLogger;
|
|
|
import com.yoho.search.service.cache.model.SearchCache;
|
|
|
import com.yoho.search.service.service.AggregationService;
|
|
|
import com.yoho.search.service.service.SearchCacheService;
|
...
|
...
|
@@ -60,6 +60,7 @@ import com.yoho.search.service.service.helper.SearchParamHelper; |
|
|
import com.yoho.search.service.service.helper.SearchSortHelper;
|
|
|
import com.yoho.search.service.servicenew.IBrandService;
|
|
|
import com.yoho.search.service.utils.SearchApiResultUtils;
|
|
|
import com.yoho.search.service.utils.SearchRequestParams;
|
|
|
import com.yoho.search.service.vo.SearchApiResult;
|
|
|
|
|
|
@Service
|
...
|
...
|
@@ -116,7 +117,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
public SearchApiResult aggBrand(Map<String, String> paramMap, BoolQueryBuilder mustFilter) {
|
|
|
try {
|
|
|
// 1、构造带filter和query的SearchParam
|
|
|
boolean needPreAggregation = "Y".equals(paramMap.getOrDefault("aggWithParamBrand", "N")) ? false : true;
|
|
|
boolean needPreAggregation = "Y".equals(paramMap.getOrDefault(SearchRequestParams.PARAM_SEARCH_AGG_WITH_PARAM_BRAND, "N")) ? false : true;
|
|
|
SearchParam searchParam = searchParamHelper.buildSearchParam(paramMap, false, mustFilter, needPreAggregation ? "brand" : null);
|
|
|
|
|
|
// 2、构造aggrations
|
...
|
...
|
@@ -290,7 +291,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
|
|
|
// 4、构建searchParam
|
|
|
SearchParam searchParam = searchParamHelper.buildWithPersional(paramMap, topHitCount > 0 ? true : false);
|
|
|
IAggregation groupBrandAgg = aggregationFactoryService.getGroupBrandAggregation(paramMap, topHitOrder, topHitCount);
|
|
|
IAggregation groupBrandAgg = aggregationFactoryService.getGroupBrandAggregation(topHitOrder, topHitCount);
|
|
|
searchParam.setAggregationBuilders(Arrays.asList(groupBrandAgg.getBuilder()));
|
|
|
searchParam.setSize(0);
|
|
|
searchParam.setOffset(topHitCount * 2);// justForCache
|
...
|
...
|
|