From 46b5f940f2f71a08833afc3b65e791ee0f07c88f Mon Sep 17 00:00:00 2001 From: moon <2623532423@qq.com> Date: Wed, 17 Sep 2025 15:05:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=98=AF=E5=90=A6=E5=B7=B2=E8=A2=ABes?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bjtds/brichat/util/EsTDatasetFilesImporter.java | 6 ++++++ 1 file changed, 6 insertions(+) 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());