...
|
...
|
@@ -126,9 +126,8 @@ public class SimilarProductServiceImpl extends BaseService implements ISimilarPr |
|
|
aggregationBuilders.add(brandIdAgg);
|
|
|
searchParam.setAggregationBuilders(aggregationBuilders);
|
|
|
// 3、设置分页
|
|
|
searchParam.setPage(0);
|
|
|
searchParam.setSize(0);
|
|
|
searchParam.setOffset(0);
|
|
|
searchParam.setSize(0);
|
|
|
// 4、先从缓存中获取,如果能取到,则直接返回
|
|
|
JSONObject sortAndBrandJSONObject = searchCacheService.getJSONObjectFromCache(searchLikeSearchCache,ISearchConstants.INDEX_NAME_PRODUCT_INDEX, searchParam);
|
|
|
if (sortAndBrandJSONObject != null) {
|
...
|
...
|
@@ -190,9 +189,8 @@ public class SimilarProductServiceImpl extends BaseService implements ISimilarPr |
|
|
searchParam.setAggregationBuilders(Arrays.asList(smallSortAndBrandAgg));
|
|
|
|
|
|
// 5、设置分页
|
|
|
searchParam.setPage(0);
|
|
|
searchParam.setSize(0);
|
|
|
searchParam.setOffset(0);
|
|
|
searchParam.setSize(0);
|
|
|
|
|
|
// 6、先从缓存中获取,如果能取到,则直接返回
|
|
|
JSONArray recommendedSknJSONArray = searchCacheService.getJSONArrayFromCache(searchLikeSearchCache,ISearchConstants.INDEX_NAME_PRODUCT_INDEX, searchParam);
|
...
|
...
|
@@ -228,7 +226,6 @@ public class SimilarProductServiceImpl extends BaseService implements ISimilarPr |
|
|
searchParam.setFiter(this.getDefaultBoolQueryBuilder());
|
|
|
searchParam.setQuery(this.builderProductQueryBuilder(paramMap, recommendSknList));
|
|
|
searchParam.setAggregationBuilders(null);
|
|
|
searchParam.setPage(page);
|
|
|
searchParam.setOffset((page - 1) * pageSize);
|
|
|
searchParam.setSize(pageSize);
|
|
|
List<SortBuilder> sortBuilders = new ArrayList<>();
|
...
|
...
|
|