...
|
...
|
@@ -27,7 +27,6 @@ import com.yoho.search.service.cache.model.SearchCache; |
|
|
import com.yoho.search.service.service.AggregationService;
|
|
|
import com.yoho.search.service.service.SearchCacheService;
|
|
|
import com.yoho.search.service.service.helper.SearchParamHelper;
|
|
|
import com.yoho.search.service.service.helper.SearchSortHelper;
|
|
|
import com.yoho.search.service.servicenew.IAggRecommendService;
|
|
|
import com.yoho.search.service.utils.SearchApiResultUtils;
|
|
|
import com.yoho.search.service.utils.SearchRequestParams;
|
...
|
...
|
@@ -40,8 +39,6 @@ public class AggRecommendServiceImpl implements IAggRecommendService { |
|
|
private static final Logger CACHE_MATCH_REQUEST = LoggerFactory.getLogger("CACHE_MATCH_REQUEST");
|
|
|
|
|
|
@Autowired
|
|
|
private SearchSortHelper searchSortHelper;
|
|
|
@Autowired
|
|
|
private AggregationService aggregationService;
|
|
|
@Autowired
|
|
|
private AggregationFactoryService aggregationFactoryService;
|
...
|
...
|
@@ -78,7 +75,7 @@ public class AggRecommendServiceImpl implements IAggRecommendService { |
|
|
if ("Y".equals(aggWithParamBrand)) {
|
|
|
needPreAggregation = false;
|
|
|
}
|
|
|
int recommendBrandCount = Integer.valueOf(paramMap.getOrDefault(SearchRequestParams.PARAM_SEARCH_VIEWNUM, "8"));
|
|
|
int recommendBrandCount = Integer.parseInt(paramMap.getOrDefault(SearchRequestParams.PARAM_SEARCH_VIEWNUM, "8"));
|
|
|
paramMap.remove(SearchRequestParams.PARAM_SEARCH_ORDER);// 此接口
|
|
|
|
|
|
// 2、构建带queryBuilder和filter的SearchParam
|
...
|
...
|
@@ -95,7 +92,7 @@ public class AggRecommendServiceImpl implements IAggRecommendService { |
|
|
final String productIndexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX;
|
|
|
JSONArray cacheJSONArray = searchCacheService.getJSONArrayFromCache(searchCache, productIndexName, searchParam);
|
|
|
if (cacheJSONArray != null) {
|
|
|
CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/aggRecommendBrand.json?" + HttpServletRequestUtils.genParamString(paramMap));
|
|
|
CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/aggRecommendBrand.json?{}", HttpServletRequestUtils.genParamString(paramMap));
|
|
|
return new SearchApiResult().setData(cacheJSONArray);
|
|
|
}
|
|
|
// 6、从ES中获取
|
...
|
...
|
@@ -137,7 +134,7 @@ public class AggRecommendServiceImpl implements IAggRecommendService { |
|
|
final String productIndexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX;
|
|
|
JSONArray cacheJSONArray = searchCacheService.getJSONArrayFromCache(searchCache, productIndexName, searchParam);
|
|
|
if (cacheJSONArray != null) {
|
|
|
CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/aggRecommendShop.json?" + HttpServletRequestUtils.genParamString(paramMap));
|
|
|
CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/aggRecommendShop.json?{}",HttpServletRequestUtils.genParamString(paramMap));
|
|
|
return this.getRecommendShopSearchApiResult(cacheJSONArray, page, count);
|
|
|
}
|
|
|
// 6、从ES中获取
|
...
|
...
|
|