|
|
@@ -1885,11 +1885,7 @@ public class SearchServiceImpl implements SearchService {
|
|
|
BooleanQuery booleanQuery = queryGoods(keyword, keywordFields, tokenized);
|
|
|
setGoodsFilter(pageParams.getFilters(), booleanQuery);
|
|
|
if (!CollectionUtils.isEmpty(storeTypes)) {
|
|
|
- BooleanQuery typeQuery = new BooleanQuery();
|
|
|
- for (String type : storeTypes) {
|
|
|
- typeQuery.add(new TermQuery(new Term(SearchConstants.GOODS_ST_TYPE_FIELD, type)), Occur.SHOULD);
|
|
|
- }
|
|
|
- booleanQuery.add(typeQuery, Occur.MUST);
|
|
|
+ filter(storeTypes, SearchConstants.GOODS_ST_TYPE_FIELD, booleanQuery);
|
|
|
}
|
|
|
logger.info(booleanQuery.toString());
|
|
|
|
|
|
@@ -2518,11 +2514,9 @@ public class SearchServiceImpl implements SearchService {
|
|
|
Map<String, BooleanQuery> queryMap = queryKindForSellers(keyword, keywordFields, tokenized);
|
|
|
BooleanQuery goodsQuery = queryMap.get("goodsQuery");
|
|
|
if (!CollectionUtils.isEmpty(storeTypes)) {
|
|
|
- BooleanQuery typeQuery = new BooleanQuery();
|
|
|
- for (String type : storeTypes) {
|
|
|
- typeQuery.add(new TermQuery(new Term(SearchConstants.GOODS_ST_TYPE_FIELD, type)), Occur.SHOULD);
|
|
|
+ if (!CollectionUtils.isEmpty(storeTypes)) {
|
|
|
+ filter(storeTypes, SearchConstants.GOODS_ST_TYPE_FIELD, goodsQuery);
|
|
|
}
|
|
|
- goodsQuery.add(typeQuery, Occur.MUST);
|
|
|
}
|
|
|
|
|
|
BooleanQuery productsQuery = queryMap.get("productsQuery");
|