Переглянути джерело

update search-service WenshuService

reghao 4 місяців тому
батько
коміт
96675c7dd8

+ 7 - 2
search/search-service/src/main/java/cn/reghao/tnb/search/app/service/WenshuService.java

@@ -50,14 +50,19 @@ public class WenshuService {
             Wenshu wenshu = parseLineByWenshu(line);
             if (wenshu != null) {
                 successCount++;
-                /*list.add(wenshu);
+                list.add(wenshu);
                 if (list.size() > 10_000) {
                     addLuceneIndex(list);
                     list.clear();
-                }*/
+                }
             }
         }
         in.close();
+
+        if (!list.isEmpty()) {
+            addLuceneIndex(list);
+            list.clear();
+        }
     }
 
     @AllArgsConstructor