{"record":{"id":"8e54a1739b98ef57","repo":"Tencent/WeKnora","slug":"failed-to-delete-by-chunk-ids-w","errorCode":null,"errorMessage":"failed to delete by chunk IDs: %w","messagePattern":"failed to delete by chunk IDs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/repository/retriever/milvus/repository.go","lineNumber":347,"sourceCode":"}\n\n// DeleteByChunkIDList removes points from the collection based on chunk IDs\nfunc (m *milvusRepository) DeleteByChunkIDList(ctx context.Context, chunkIDList []string, dimension int, knowledgeType string) error {\n\tlog := logger.GetLogger(ctx)\n\tif len(chunkIDList) == 0 {\n\t\tlog.Warn(\"[Milvus] Empty chunk ID list provided for deletion, skipping\")\n\t\treturn nil\n\t}\n\n\tcollectionName := m.getCollectionName(dimension)\n\tlog.Infof(\"[Milvus] Deleting indices by chunk IDs from %s, count: %d\", collectionName, len(chunkIDList))\n\n\tdeleteOpt := client.NewDeleteOption(collectionName)\n\tdeleteOpt.WithStringIDs(fieldChunkID, chunkIDList)\n\t_, err := m.client.Delete(ctx, deleteOpt)\n\tif err != nil {\n\t\tlog.Errorf(\"[Milvus] Failed to delete by chunk IDs: %v\", err)\n\t\treturn fmt.Errorf(\"failed to delete by chunk IDs: %w\", err)\n\t}\n\n\tlog.Infof(\"[Milvus] Successfully deleted documents by chunk IDs\")\n\treturn nil\n}\n\n// DeleteByKnowledgeIDList removes points from the collection based on knowledge IDs\nfunc (m *milvusRepository) DeleteByKnowledgeIDList(ctx context.Context,\n\tknowledgeIDList []string, dimension int, knowledgeType string,\n) error {\n\tlog := logger.GetLogger(ctx)\n\tif len(knowledgeIDList) == 0 {\n\t\tlog.Warn(\"[Milvus] Empty knowledge ID list provided for deletion, skipping\")\n\t\treturn nil\n\t}\n\n\tcollectionName := m.getCollectionName(dimension)\n\tlog.Infof(\"[Milvus] Deleting indices by knowledge IDs from %s, count: %d\", collectionName, len(knowledgeIDList))","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/repository/retriever/milvus/repository.go#L329-L365","documentation":"Milvus delete-by-chunk-IDs operation failed: the Delete call with the string ID filter errored (connectivity, collection state, or filter rejection), so the indexed points for those chunks are not removed.","triggerScenarios":"Thrown at internal/application/repository/retriever/milvus/repository.go:347 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped Milvus error","Verify the collection exists and is loaded for the dimension","Retry deletion; stale points otherwise remain searchable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}