1
|
package com.yoho.search.service.scene.common;
|
1
|
package com.yoho.search.service.scene.common;
|
2
|
|
2
|
|
3
|
import java.util.ArrayList;
|
3
|
import java.util.ArrayList;
|
|
|
4
|
+import java.util.HashMap;
|
4
|
import java.util.List;
|
5
|
import java.util.List;
|
5
|
import java.util.Map;
|
6
|
import java.util.Map;
|
6
|
import java.util.concurrent.CompletableFuture;
|
7
|
import java.util.concurrent.CompletableFuture;
|
|
@@ -225,19 +226,21 @@ public class SceneSelectionsService extends BaseService { |
|
@@ -225,19 +226,21 @@ public class SceneSelectionsService extends BaseService { |
225
|
|
226
|
|
226
|
private JSONObject getFiltersResult(Map<String, String> paramMap, List<IAggregation> aggregations, BoolQueryBuilder mustFilter) {
|
227
|
private JSONObject getFiltersResult(Map<String, String> paramMap, List<IAggregation> aggregations, BoolQueryBuilder mustFilter) {
|
227
|
try {
|
228
|
try {
|
228
|
- SearchParam searchParam = searchParamHelper.buildWithMustFilter(paramMap, mustFilter);
|
229
|
+ Map<String, String> newParamMap = new HashMap<String, String>(paramMap);
|
|
|
230
|
+ SearchParam searchParam = searchParamHelper.buildWithMustFilter(newParamMap, mustFilter);
|
229
|
return this.getFiltersResults(paramMap, searchParam, aggregations);
|
231
|
return this.getFiltersResults(paramMap, searchParam, aggregations);
|
230
|
} catch (Exception e) {
|
232
|
} catch (Exception e) {
|
231
|
- logger.error("[func=fuzzyAggregations][params=" + paramMap + "]", e);
|
233
|
+ logger.error("[func=SceneSelectionsService][params=" + paramMap + "]", e);
|
232
|
return new JSONObject();
|
234
|
return new JSONObject();
|
233
|
}
|
235
|
}
|
234
|
}
|
236
|
}
|
235
|
-
|
237
|
+
|
236
|
private JSONArray getRecommendBrands(Map<String, String> paramMap, BoolQueryBuilder mustFilter) {
|
238
|
private JSONArray getRecommendBrands(Map<String, String> paramMap, BoolQueryBuilder mustFilter) {
|
237
|
- SearchApiResult searchApiResult = aggRecommendService.aggRecommendBrand(paramMap, mustFilter);
|
239
|
+ Map<String, String> newParamMap = new HashMap<String, String>(paramMap);
|
|
|
240
|
+ SearchApiResult searchApiResult = aggRecommendService.aggRecommendBrand(newParamMap, mustFilter);
|
238
|
return (JSONArray) searchApiResult.getData();
|
241
|
return (JSONArray) searchApiResult.getData();
|
239
|
}
|
242
|
}
|
240
|
-
|
243
|
+
|
241
|
public SearchApiResult aggregations(Map<String, String> paramMap) throws Exception {
|
244
|
public SearchApiResult aggregations(Map<String, String> paramMap) throws Exception {
|
242
|
List<IAggregation> commonAggregations = this.getCommonAggregations(paramMap);
|
245
|
List<IAggregation> commonAggregations = this.getCommonAggregations(paramMap);
|
243
|
return this.aggregations(paramMap, commonAggregations, null);
|
246
|
return this.aggregations(paramMap, commonAggregations, null);
|