|
@@ -762,14 +762,22 @@ public class EsPatentService {
|
|
|
}
|
|
|
}
|
|
|
String condition = esService.appendIdsCondition(searchCondition, taskId, productFrom, projectId, productId);
|
|
|
+
|
|
|
+ Query q =null;
|
|
|
+ if(condition==null||condition.trim().equals("")){
|
|
|
+ q =QueryBuilders.exists(i->i.field("patent_no"));
|
|
|
+ }
|
|
|
+ else {
|
|
|
//1. 解析检索条件
|
|
|
treeNode tree = expressManager.getInstance().Parse(condition, false);
|
|
|
//3. 从es中检索数据
|
|
|
- Query q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
|
|
|
+ q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
|
|
|
+ }
|
|
|
+ Query finalQ=q;
|
|
|
Query reQuery = null;
|
|
|
if (patentNos != null && patentNos.size() > 0) {
|
|
|
List<Query> notInQuery = this.getNoNotInQuery(patentNos);
|
|
|
- reQuery = QueryBuilders.bool(i -> i.must(q).mustNot(notInQuery));
|
|
|
+ reQuery = QueryBuilders.bool(i -> i.must(finalQ).mustNot(notInQuery));
|
|
|
} else {
|
|
|
reQuery = q;
|
|
|
}
|