|
@@ -174,7 +174,7 @@ public class EsService {
|
|
commonVO.setTaskId(taskId);
|
|
commonVO.setTaskId(taskId);
|
|
commonVO.setProjectId(projectId);
|
|
commonVO.setProjectId(projectId);
|
|
commonVO.setProductId(productId);
|
|
commonVO.setProductId(productId);
|
|
- if (searchCondition.contains("罒")) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(searchCondition) && searchCondition.contains("罒")) {
|
|
String replace = searchCondition.replace("罒", " OR ");
|
|
String replace = searchCondition.replace("罒", " OR ");
|
|
commonVO.setSearchCondition(replace);
|
|
commonVO.setSearchCondition(replace);
|
|
} else {
|
|
} else {
|
|
@@ -189,7 +189,12 @@ public class EsService {
|
|
SearchRequest.Builder builder = this.getCommonPatent(commonVO);
|
|
SearchRequest.Builder builder = this.getCommonPatent(commonVO);
|
|
//解除最大条数限制
|
|
//解除最大条数限制
|
|
builder.trackTotalHits(i -> i.enabled(true));
|
|
builder.trackTotalHits(i -> i.enabled(true));
|
|
- SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
|
|
|
+ SearchResponse<Patent> response = null;
|
|
|
|
+ try {
|
|
|
|
+ response = client.search(builder.build(), Patent.class);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new XiaoShiException("检索错误,请检查检索式");
|
|
|
|
+ }
|
|
List<PatentColumnDTO> list = new ArrayList<>();
|
|
List<PatentColumnDTO> list = new ArrayList<>();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
long total = 0L;
|
|
long total = 0L;
|
|
@@ -1456,7 +1461,7 @@ public class EsService {
|
|
commonVO.setTaskId(taskId);
|
|
commonVO.setTaskId(taskId);
|
|
commonVO.setProjectId(projectId);
|
|
commonVO.setProjectId(projectId);
|
|
commonVO.setProductId(productId);
|
|
commonVO.setProductId(productId);
|
|
- if (searchCondition.contains("罒")) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(searchCondition) && searchCondition.contains("罒")) {
|
|
String replace = searchCondition.replace("罒", " OR ");
|
|
String replace = searchCondition.replace("罒", " OR ");
|
|
commonVO.setSearchCondition(replace);
|
|
commonVO.setSearchCondition(replace);
|
|
} else {
|
|
} else {
|