|
@@ -111,6 +111,7 @@ public class EsService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public PatentWithIdVO getIdByPatentNo(String patentNo) throws Exception {
|
|
|
+ String patentNo1 = patentNo.replace(" ", "");
|
|
|
SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
|
//设置查询索引
|
|
|
builder.index("patent");
|
|
@@ -122,7 +123,7 @@ public class EsService {
|
|
|
// //授权号
|
|
|
// Query q3 = QueryBuilders.term(t -> t.field("grant_no.keyword").value(patentNo));
|
|
|
// Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
|
|
|
- Query query = QueryBuilders.term(t -> t.field("patent_no.keyword").value(patentNo));
|
|
|
+ Query query = QueryBuilders.term(t -> t.field("patent_no.keyword").value(patentNo1));
|
|
|
builder.query(query);
|
|
|
SearchResponse<Patent> response = null;
|
|
|
try {
|