|
|
package com.yoho.search.service.scene.common;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.CompletableFuture;
|
...
|
...
|
@@ -225,19 +226,21 @@ public class SceneSelectionsService extends BaseService { |
|
|
|
|
|
private JSONObject getFiltersResult(Map<String, String> paramMap, List<IAggregation> aggregations, BoolQueryBuilder mustFilter) {
|
|
|
try {
|
|
|
SearchParam searchParam = searchParamHelper.buildWithMustFilter(paramMap, mustFilter);
|
|
|
Map<String, String> newParamMap = new HashMap<String, String>(paramMap);
|
|
|
SearchParam searchParam = searchParamHelper.buildWithMustFilter(newParamMap, mustFilter);
|
|
|
return this.getFiltersResults(paramMap, searchParam, aggregations);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("[func=fuzzyAggregations][params=" + paramMap + "]", e);
|
|
|
logger.error("[func=SceneSelectionsService][params=" + paramMap + "]", e);
|
|
|
return new JSONObject();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private JSONArray getRecommendBrands(Map<String, String> paramMap, BoolQueryBuilder mustFilter) {
|
|
|
SearchApiResult searchApiResult = aggRecommendService.aggRecommendBrand(paramMap, mustFilter);
|
|
|
Map<String, String> newParamMap = new HashMap<String, String>(paramMap);
|
|
|
SearchApiResult searchApiResult = aggRecommendService.aggRecommendBrand(newParamMap, mustFilter);
|
|
|
return (JSONArray) searchApiResult.getData();
|
|
|
}
|
|
|
|
|
|
|
|
|
public SearchApiResult aggregations(Map<String, String> paramMap) throws Exception {
|
|
|
List<IAggregation> commonAggregations = this.getCommonAggregations(paramMap);
|
|
|
return this.aggregations(paramMap, commonAggregations, null);
|
...
|
...
|
|