RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Regards kb_id at ElasticSearch insert, update, delete. (#6105)
Zhichang Yu4fffee669561
diff --git a/rag/utils/es_conn.py b/rag/utils/es_conn.pyindex 89687e1bd6..a8dd653174 100644--- a/rag/utils/es_conn.py+++ b/rag/utils/es_conn.py@@ -284,6 +284,7 @@ class ESConnection(DocStoreConnection):assert "_id" not in dassert "id" in dd_copy = copy.deepcopy(d)+ d_copy["kb_id"] = knowledgebaseIdmeta_id = d_copy.pop("id", "")operations.append({"index": {"_index": indexName, "_id": meta_id}})@@ -316,6 +317,7 @@ class ESConnection(DocStoreConnection):def update(self, condition: dict, newValue: dict, indexName: str, knowledgebaseId: str) -> bool:doc = copy.deepcopy(newValue)doc.pop("id", None)+ condition["kb_id"] = knowledgebaseIdif "id" in condition and isinstance(condition["id"], str):# update specific single documentchunkId = condition["id"]@@ -399,6 +401,7 @@ class ESConnection(DocStoreConnection):def delete(self, condition: dict, indexName: str, knowledgebaseId: str) -> int:qry = Noneassert "_id" not in condition+ condition["kb_id"] = knowledgebaseIdif "id" in condition:chunk_ids = condition["id"]if not isinstance(chunk_ids, list):