...
|
...
|
@@ -87,19 +87,17 @@ public class SearchProductsServiceNew { |
|
|
// 进行检索
|
|
|
final String indexName = ISearchConstans.INDEX_NAME_PRODUCT_INDEX;
|
|
|
SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam);
|
|
|
|
|
|
// 将searchResult转化为map返回--需要把aggregation转化为需要的结构
|
|
|
if (searchResult == null) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
// 构造返回结果
|
|
|
Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
dataMap.put("total", searchResult.getTotal());
|
|
|
dataMap.put("page", searchResult.getPage());
|
|
|
dataMap.put("page_total", searchResult.getTotalPage());
|
|
|
dataMap.put("product_list", searchServiceHelper.getProductMapList(searchResult.getResultList()));
|
|
|
if (searchResult.getAggMaps() != null) {
|
|
|
if (paramMap.containsKey("needFilter") && "1".equals(paramMap.get("needFilter"))) {
|
|
|
dataMap.put("filter", buildFilterResult(aggregationResult, paramMap));
|
|
|
}
|
|
|
Map<String, Object> jsonMap = new HashMap<String, Object>();
|
...
|
...
|
|