From 5ae33184d5e349b1d56e0c699b3180e172e4999e Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 5 Dec 2024 10:53:26 +0800 Subject: [PATCH] Fix chunk position issue. (#3867) ### What problem does this PR solve? Close #3864 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/chunk_app.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/api/apps/chunk_app.py b/api/apps/chunk_app.py index 90d04b044..b6a978e31 100644 --- a/api/apps/chunk_app.py +++ b/api/apps/chunk_app.py @@ -60,11 +60,6 @@ def list_chunk(): sres = settings.retrievaler.search(query, search.index_name(tenant_id), kb_ids, highlight=True) res = {"total": sres.total, "chunks": [], "doc": doc.to_dict()} for id in sres.ids: - chunk_elem = sres.field[id] - if 'position_list' in chunk_elem: - if isinstance(chunk_elem["position_list"], str): - chunk_elem.pop('position_list') # Infinity will store position list as empty str - d = { "chunk_id": id, "content_with_weight": rmSpace(sres.highlight[id]) if question and id in sres.highlight else sres.field[