修改了检查文件是否已被es构建

This commit is contained in:
moon 2025-09-17 15:05:00 +08:00
parent 801bbe4970
commit 46b5f940f2
1 changed files with 6 additions and 0 deletions

View File

@ -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());