...
|
...
|
@@ -52,6 +52,7 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
|
|
|
|
|
ApplicationEventPublisher publisher;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private SearchCommonService searchCommonService;
|
|
|
@Autowired
|
...
|
...
|
@@ -225,24 +226,26 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
|
|
}
|
|
|
}
|
|
|
|
|
|
//tbl判断
|
|
|
SearchApiResult searchApiResult = searchTbl(paramMap,keyword);
|
|
|
SearchApiResult searchApiResult = new SearchApiResult();
|
|
|
JSONObject returnMap = new JSONObject();
|
|
|
returnMap.put("shop", null);
|
|
|
returnMap.put("brand", null);
|
|
|
returnMap.put("tblBrand", null);
|
|
|
if (searchApiResult.getData() != null) {
|
|
|
Map<String, Object> shopInfoMap = (Map<String, Object>) searchApiResult.getData();
|
|
|
JSONObject shopDataMap = new JSONObject();
|
|
|
Integer shopIdNumber = Integer.valueOf(shopInfoMap.get("shopsId").toString());
|
|
|
shopDataMap.put("brand_id", shopIdNumber * (-1));
|
|
|
shopDataMap.put("brand_name", shopInfoMap.get("shopName") == null ? "" : shopInfoMap.get("shopName"));
|
|
|
shopDataMap.put("brand_logo", shopInfoMap.get("shopLogo") == null ? "" : shopInfoMap.get("shopLogo"));
|
|
|
returnMap.put("tblBrand", shopDataMap);
|
|
|
return searchApiResult.setData(returnMap);
|
|
|
//tbl判断
|
|
|
if (paramMap.containsKey("contain_global") && "Y".equals(paramMap.get("contain_global"))) {
|
|
|
searchApiResult = searchTbl(paramMap, keyword);
|
|
|
if (searchApiResult.getData() != null) {
|
|
|
Map<String, Object> shopInfoMap = (Map<String, Object>) searchApiResult.getData();
|
|
|
JSONObject shopDataMap = new JSONObject();
|
|
|
Integer shopIdNumber = Integer.valueOf(shopInfoMap.get("shopsId").toString());
|
|
|
shopDataMap.put("brand_id", shopIdNumber * (-1));
|
|
|
shopDataMap.put("brand_name", shopInfoMap.get("shopName") == null ? "" : shopInfoMap.get("shopName"));
|
|
|
shopDataMap.put("brand_logo", shopInfoMap.get("shopLogo") == null ? "" : shopInfoMap.get("shopLogo"));
|
|
|
returnMap.put("tblBrand", shopDataMap);
|
|
|
return searchApiResult.setData(returnMap);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
// 2、配置keyword的查询字段以及权重设置
|
|
|
MultiMatchQueryBuilder queryBuilder = QueryBuilders.multiMatchQuery(keyword);
|
|
|
queryBuilder.operator(MatchQueryBuilder.Operator.OR);
|
...
|
...
|
@@ -315,6 +318,7 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
|
|
|
|
|
/**
|
|
|
* shopsNew中搜索是否有匹配的全球购店铺,如果有直接返回。
|
|
|
*
|
|
|
* @param paramMap
|
|
|
* @param keyword
|
|
|
* @return
|
...
|
...
|
@@ -468,6 +472,9 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl |
|
|
*/
|
|
|
private BoolQueryBuilder constructShopsFilterBuilder(Map<String, String> paramMap) throws Exception {
|
|
|
BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
|
|
|
if (!paramMap.containsKey("contain_global") && !"Y".equals(paramMap.get("contain_global"))) {
|
|
|
boolFilter = boolFilter.must(QueryBuilders.termQuery("contain_global", "N"));
|
|
|
}
|
|
|
boolFilter = BoolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.SHOPS_PARAM_BLKSTATUS);
|
|
|
boolFilter = BoolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.SHOPS_PARAM_CHECKSTATUS);
|
|
|
boolFilter = BoolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.SHOPS_PARAM_EXAMINESTATUS);
|
...
|
...
|
|