|
|
@@ -1204,7 +1204,7 @@ public class SearchServiceImpl implements SearchService {
|
|
|
|
|
|
Sort sort = sortPCBGoods(keyword, pageParams.getSort());
|
|
|
TopDocs hits;
|
|
|
- if (pageParams.getPage() > 1) {// 不是第一页
|
|
|
+ if (pageParams.getPage() > 1) { // 不是第一页
|
|
|
TopDocs previousHits = indexSearcher.search(booleanQuery,
|
|
|
(pageParams.getPage() - 1) * pageParams.getSize(), sort, true, false);
|
|
|
int totalHits = previousHits.totalHits;
|
|
|
@@ -1604,6 +1604,11 @@ public class SearchServiceImpl implements SearchService {
|
|
|
booleanQuery.add(new PrefixQuery(new Term(SearchConstants.PCB_GOODS_PR_PCMPCODE_FIELD, keyword.toLowerCase())), BooleanClause.Occur.SHOULD);
|
|
|
// PCB
|
|
|
booleanQuery.add(createQuery(SearchConstants.PCB_GOODS_PR_PCMPCODE_FIELD, keyword, 100), Occur.SHOULD);
|
|
|
+ // 品牌
|
|
|
+ booleanQuery.add(createQuery(SearchConstants.PCB_GOODS_BR_NAME_CN_FIELD, keyword, 10), BooleanClause.Occur.SHOULD);
|
|
|
+ booleanQuery.add(createQuery(SearchConstants.PCB_GOODS_BR_NAME_EN_FIELD, keyword, 10), BooleanClause.Occur.SHOULD);
|
|
|
+ // 类目
|
|
|
+ booleanQuery.add(createQuery(SearchConstants.PCB_GOODS_KI_NAME_CN_FIELD, keyword, 1), BooleanClause.Occur.SHOULD);
|
|
|
return booleanQuery;
|
|
|
}
|
|
|
|