diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/KnowledgeFileInfoService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/KnowledgeFileInfoService.java index 52d11df..db445bb 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/KnowledgeFileInfoService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/KnowledgeFileInfoService.java @@ -17,6 +17,7 @@ import java.util.List; */ public interface KnowledgeFileInfoService extends IService { String SEGMENT_URL = "/kn/doc_segment"; + String VECTOR_DATABASE_NAME = "knowledge_data"; Boolean store(IdRequest req); diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java index 8f9f29c..5e1252b 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.gglm.bigmodel.database.service.WeaviateService; import com.hnac.gglm.bigmodel.maintenance.constants.StoreStatus; import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileFragment; import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileInfo; @@ -45,6 +46,7 @@ public class KnowledgeFileInfoServiceImpl extends ServiceImpl idsList) { Boolean result = removeByIds(idsList); if (result) { - fileFragmentService.remove(Wrappers.lambdaQuery().in(KnowledgeFileFragment::getDocId, idsList)); + try { + fileFragmentService.remove(Wrappers.lambdaQuery().in(KnowledgeFileFragment::getDocId, idsList)); + for (Long id : idsList) { + Map condition = new HashMap<>(); + condition.put("doc_id", id.toString()); + weaviateService.deleteCondition(VECTOR_DATABASE_NAME, condition); + } + } catch (Exception e) { + log.error("删除知识库文件文件出错", e); + } } return result; }