소스 검색

fixed 同族

zero 1 년 전
부모
커밋
bba9f93fb0
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

+ 3 - 3
src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

@@ -440,11 +440,11 @@ public class EsPatentService {
             String s = str.concat(patentNo).concat("*");
             Query query = QueryBuilders.wildcard(i -> i.field("patent_no.keyword").value(s));
             if (query1 != null && query2 == null) {
-                bool = QueryBuilders.bool(i -> i.should(query1));
+                bool = QueryBuilders.bool(i -> i.should(query1).must(query));
             } else if (query2 != null && query1 == null) {
-                bool = QueryBuilders.bool(i -> i.should(query2));
+                bool = QueryBuilders.bool(i -> i.should(query2).must(query));
             } else {
-                bool = QueryBuilders.bool(i -> i.should(query1, query2));
+                bool = QueryBuilders.bool(i -> i.should(query1, query2).must(query));
             }
         } else {
             if (query1 != null && query2 == null) {