Pārlūkot izejas kodu

20241127 语义检索

lwhhszx 10 mēneši atpakaļ
vecāks
revīzija
cc56d4de3a

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

@@ -935,7 +935,6 @@ public class EsPatentService {
         }
             SearchResponse<Patent> response = null;
         builder.query(query);
-        builder.query(query);
 
         if (current > 0 && size > 0) {
             builder.from((current.intValue() - 1) * size.intValue()).size(size.intValue());
@@ -945,6 +944,7 @@ public class EsPatentService {
         try {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
+            e.printStackTrace();
             throw new XiaoShiException("检索错误,请检查检索式");
         }
         List<PatentColumnDTO> list = new ArrayList<>();

+ 5 - 2
src/main/java/cn/cslg/pas/service/business/es/EsPatentVectorService.java

@@ -69,6 +69,9 @@ public class EsPatentVectorService {
 
         if (patent.getAbstractStr() != null && patent.getAbstractStr().size() > 0) {
             Text text = patent.getAbstractStr().stream().filter(item -> item.getIfOrigin().equals(true)).findFirst().orElse(null);
+            if(text==null){
+                text =patent.getAbstractStr().get(0);
+            }
             if (text != null) {
                 String abStr = text.getTextContent();
                 GetVectorVO getVectorVO = new GetVectorVO();
@@ -88,9 +91,9 @@ public class EsPatentVectorService {
 
     public void refreshPatentVector(Integer id) {
 
-        long total = 1l;
+        long total = 21000l;
         long size = 50l;
-        long current = 0l;
+        long current = 249l;
 
         while (size * current < total) {
             current += 1;

+ 3 - 3
src/main/java/cn/cslg/pas/service/test/PermissionService2.java

@@ -60,7 +60,7 @@ public class PermissionService2 {
                 .readTimeout(60, TimeUnit.SECONDS)
                 .build();
         Request request = new Request.Builder()
-                .url(PCSUrl + "/permission/api/admin/loginByEncryption")
+                .url("https://xsip.cn/" + "api/permission/api/admin/loginByEncryption")
                 .post(requestBody)
                 .build();
         return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
@@ -75,7 +75,7 @@ public class PermissionService2 {
         String appSecret = appKey + currentTimeMillis / 1000;
         String md5Sign = SecureUtil.md5(appSecret);
         encryptionFunctionDTO.setSign(md5Sign);
-        encryptionFunctionDTO.setVersion("1");
+        encryptionFunctionDTO.setVersion("1.0.0.2");
         String param = new Gson().toJson(encryptionFunctionDTO);
 
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
@@ -85,7 +85,7 @@ public class PermissionService2 {
                 .readTimeout(60, TimeUnit.SECONDS)
                 .build();
         Request request = new Request.Builder()
-                .url(PCSUrl + "/permission/api/admin/functionByEncryption")
+                .url(PCSUrl + "api/permission/api/admin/functionByEncryption")
                 .addHeader("Cookie", "token="+token)
                 .post(requestBody)
                 .build();