From 49f3f266227ce4012f4977f58adf7709027e6c57 Mon Sep 17 00:00:00 2001 From: pyyuhao Date: Fri, 25 Jul 2025 09:57:24 +0800 Subject: [PATCH] Bug fix: OpenSearch chunk update some api error (#9032) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What problem does this PR solve? Fix a small non-blocking main workflow bug about chunk update When OpenSearch is the doc engine. When you wanna enable/disable a chunk in the web-page “Knowledge Base / Dataset / Chunk”, the bug ocurred. image The reaseon why it ocurred is that some api params between OpenSearch and ES differs. It functioned well no matter enable/disable/rewrite the chunk after I fixed. I also checked the result when using the chat web-page. image I will still focus on vector-database espeically OpenSearch. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: 张雨豪 Co-authored-by: Kevin Hu --- rag/utils/opensearch_conn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/utils/opensearch_conn.py b/rag/utils/opensearch_conn.py index 4fd09b782..b53a6123f 100644 --- a/rag/utils/opensearch_conn.py +++ b/rag/utils/opensearch_conn.py @@ -329,7 +329,7 @@ class OSConnection(DocStoreConnection): chunkId = condition["id"] for i in range(ATTEMPT_TIME): try: - self.os.update(index=indexName, id=chunkId, body=doc) + self.os.update(index=indexName, id=chunkId, body={"doc":doc}) return True except Exception as e: logger.exception(