|
@@ -55,8 +55,6 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
|
@@ -55,8 +55,6 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
55
|
@Autowired
|
55
|
@Autowired
|
56
|
private AggregationService aggregationService;
|
56
|
private AggregationService aggregationService;
|
57
|
@Autowired
|
57
|
@Autowired
|
58
|
- private SearchCommonHelper searchCommonHelper;
|
|
|
59
|
- @Autowired
|
|
|
60
|
private AggregationFactoryService aggregationFactoryService;
|
58
|
private AggregationFactoryService aggregationFactoryService;
|
61
|
@Autowired
|
59
|
@Autowired
|
62
|
private SearchParamHelper searchParamHelper;
|
60
|
private SearchParamHelper searchParamHelper;
|
|
@@ -76,14 +74,12 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
|
@@ -76,14 +74,12 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
76
|
int topHitCount = StringUtils.isBlank(paramMap.get("viewNum")) ? 10 : Integer.parseInt(paramMap.get("viewNum"));
|
74
|
int topHitCount = StringUtils.isBlank(paramMap.get("viewNum")) ? 10 : Integer.parseInt(paramMap.get("viewNum"));
|
77
|
// 2、获取聚合的排序规则
|
75
|
// 2、获取聚合的排序规则
|
78
|
String topHitOrder = "heatValue:desc";
|
76
|
String topHitOrder = "heatValue:desc";
|
79
|
-
|
|
|
80
|
// 3、构建searchParam
|
77
|
// 3、构建searchParam
|
81
|
- SearchParam searchParam = searchParamHelper.buildWithPersional(paramMap, topHitCount > 0 ? true : false);
|
78
|
+ SearchParam searchParam = searchParamHelper.buildWithPersional(paramMap, false);
|
82
|
IAggregation groupShopAgg = aggregationFactoryService.getGroupShopAggregation(topHitOrder, topHitCount);
|
79
|
IAggregation groupShopAgg = aggregationFactoryService.getGroupShopAggregation(topHitOrder, topHitCount);
|
83
|
searchParam.setAggregationBuilders(Arrays.asList(groupShopAgg.getBuilder()));
|
80
|
searchParam.setAggregationBuilders(Arrays.asList(groupShopAgg.getBuilder()));
|
84
|
searchParam.setOffset(0);
|
81
|
searchParam.setOffset(0);
|
85
|
searchParam.setSize(0);
|
82
|
searchParam.setSize(0);
|
86
|
-
|
|
|
87
|
// 4、从ES中获取
|
83
|
// 4、从ES中获取
|
88
|
JSONObject aggNameAndResponse = aggregationService.getAggNameAndResponseWithTotal(groupShopAgg, searchParam);
|
84
|
JSONObject aggNameAndResponse = aggregationService.getAggNameAndResponseWithTotal(groupShopAgg, searchParam);
|
89
|
if (aggNameAndResponse == null) {
|
85
|
if (aggNameAndResponse == null) {
|