mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Bug fix: OpenSearch chunk update some api error (#9032)
### 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. <img width="2388" height="662" alt="image" src="https://github.com/user-attachments/assets/575987a0-c929-4589-bfa0-ba54e137cfd9" /> 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. <img width="2394" height="660" alt="image" src="https://github.com/user-attachments/assets/8b899dc6-d769-4e80-8dd8-ad0fbbca5f78" /> 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: 张雨豪 <zhangyh80@chinatelecom.cn> Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
@ -329,7 +329,7 @@ class OSConnection(DocStoreConnection):
|
|||||||
chunkId = condition["id"]
|
chunkId = condition["id"]
|
||||||
for i in range(ATTEMPT_TIME):
|
for i in range(ATTEMPT_TIME):
|
||||||
try:
|
try:
|
||||||
self.os.update(index=indexName, id=chunkId, body=doc)
|
self.os.update(index=indexName, id=chunkId, body={"doc":doc})
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(
|
logger.exception(
|
||||||
|
|||||||
Reference in New Issue
Block a user