|
|
@@ -55,9 +55,9 @@ public class SearchServiceImpl implements SearchService {
|
|
|
* @throws IOException 输入异常
|
|
|
*/
|
|
|
@Override
|
|
|
- public SPage<Long> getStandardProductIds(String keyword, Integer page, Integer size) throws IOException {
|
|
|
+ public SPage<Long> getStandardProductIds(Long enUU, String keyword, Integer page, Integer size) throws IOException {
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
- SPage<Document> documents = getStandardProductDocuments(keyword, page, size);
|
|
|
+ SPage<Document> documents = getStandardProductDocuments(enUU, keyword, page, size);
|
|
|
SPage<Long> sPage = new SPage<>(documents.getTotalPage(), documents.getTotalElement(), documents.getPage(),
|
|
|
documents.getSize(), documents.isFirst(), documents.isLast());
|
|
|
for (Document document : documents.getContent()) {
|
|
|
@@ -77,9 +77,9 @@ public class SearchServiceImpl implements SearchService {
|
|
|
* @throws IOException 输入异常
|
|
|
*/
|
|
|
@Override
|
|
|
- public SPage<Long> getNonStandardProductIds(String keyword, Integer page, Integer size) throws IOException {
|
|
|
+ public SPage<Long> getNonStandardProductIds(Long enUU, String keyword, Integer page, Integer size) throws IOException {
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
- SPage<Document> documents = getNonStandardProductDocuments(keyword, page, size);
|
|
|
+ SPage<Document> documents = getNonStandardProductDocuments(enUU, keyword, page, size);
|
|
|
SPage<Long> sPage = new SPage<>(documents.getTotalPage(), documents.getTotalElement(), documents.getPage(),
|
|
|
documents.getSize(), documents.isFirst(), documents.isLast());
|
|
|
for (Document document : documents.getContent()) {
|
|
|
@@ -89,11 +89,12 @@ public class SearchServiceImpl implements SearchService {
|
|
|
return sPage;
|
|
|
}
|
|
|
|
|
|
- private SPage<Document> getStandardProductDocuments(String keyword, Integer page, Integer size) throws IOException {
|
|
|
+ private SPage<Document> getStandardProductDocuments(Long enUU, String keyword, Integer page, Integer size) throws IOException {
|
|
|
// if (SearchUtils.isKeywordInvalid(keyword)) {
|
|
|
// throw new IllegalArgumentException("搜索关键词无效:" + keyword);
|
|
|
// }
|
|
|
BooleanQuery q1 = new BooleanQuery();
|
|
|
+ q1.add(new TermQuery(new Term(SearchConstants.PRODUCT_PRIVATE_ENUU_FIELD, String.valueOf(enUU))), BooleanClause.Occur.MUST);
|
|
|
q1.add(new TermQuery(new Term(SearchConstants.PRODUCT_PRIVATE_STANDARD_FIELD, String.valueOf(1))), BooleanClause.Occur.MUST);
|
|
|
q1.add(new TermQuery(new Term(SearchConstants.PRODUCT_PRIVATE_B2CENABLED_FIELD, String.valueOf(1))), BooleanClause.Occur.MUST);
|
|
|
BooleanQuery booleanQuery = new BooleanQuery();
|
|
|
@@ -109,11 +110,12 @@ public class SearchServiceImpl implements SearchService {
|
|
|
return SearchUtils.getDocuments(SearchConstants.PRODUCTS_PRIVATE_TABLE_NAME, booleanQuery, new Sort(sortProduct(keyword)), page, size);
|
|
|
}
|
|
|
|
|
|
- private SPage<Document> getNonStandardProductDocuments(String keyword, Integer page, Integer size) throws IOException {
|
|
|
+ private SPage<Document> getNonStandardProductDocuments(Long enUU, String keyword, Integer page, Integer size) throws IOException {
|
|
|
// if (SearchUtils.isKeywordInvalid(keyword)) {
|
|
|
// throw new IllegalArgumentException("搜索关键词无效:" + keyword);
|
|
|
// }
|
|
|
BooleanQuery q1 = new BooleanQuery();
|
|
|
+ q1.add(new TermQuery(new Term(SearchConstants.PRODUCT_PRIVATE_ENUU_FIELD, String.valueOf(enUU))), BooleanClause.Occur.MUST);
|
|
|
q1.add(new TermQuery(new Term(SearchConstants.PRODUCT_PRIVATE_STANDARD_FIELD, String.valueOf(0))), BooleanClause.Occur.MUST);
|
|
|
q1.add(new TermQuery(new Term(SearchConstants.PRODUCT_PRIVATE_B2CENABLED_FIELD, String.valueOf(1))), BooleanClause.Occur.MUST);
|
|
|
BooleanQuery booleanQuery = new BooleanQuery();
|