diff --git a/chat-server/src/main/java/com/bjtds/brichat/util/EsTDatasetFilesImporter.java b/chat-server/src/main/java/com/bjtds/brichat/util/EsTDatasetFilesImporter.java index 7203124..5e2790a 100644 --- a/chat-server/src/main/java/com/bjtds/brichat/util/EsTDatasetFilesImporter.java +++ b/chat-server/src/main/java/com/bjtds/brichat/util/EsTDatasetFilesImporter.java @@ -65,12 +65,18 @@ public class EsTDatasetFilesImporter { log.debug(filePath + " 不存在,跳过"); continue; } + if(document.getIsEs()){ + log.info("documentId=" + document.getId() + " 是ES索引文件,跳过"); + continue; + } // 调用你的文件处理逻辑,将文件内容与 document 信息一起构建索引 try { processFileWithDocumentInfo(document); finished++; redisTemplate.opsForValue().set("import:task:" + taskId + ":finished", String.valueOf(finished)); + document.setIsEs(true); + datasetFilesService.updateFile(document); log.debug("documentId=" + document.getId() + " 索引构建成功"); } catch (Exception e) { log.debug("documentId=" + document.getId() + " 索引构建失败: " + e.getMessage());