Kevin Hu
commited on
Commit
·
23aa27e
1
Parent(s):
4e421c5
Fix chunk position issue. (#3867)
Browse files### 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 +0 -5
api/apps/chunk_app.py
CHANGED
@@ -60,11 +60,6 @@ def list_chunk():
|
|
60 |
sres = settings.retrievaler.search(query, search.index_name(tenant_id), kb_ids, highlight=True)
|
61 |
res = {"total": sres.total, "chunks": [], "doc": doc.to_dict()}
|
62 |
for id in sres.ids:
|
63 |
-
chunk_elem = sres.field[id]
|
64 |
-
if 'position_list' in chunk_elem:
|
65 |
-
if isinstance(chunk_elem["position_list"], str):
|
66 |
-
chunk_elem.pop('position_list') # Infinity will store position list as empty str
|
67 |
-
|
68 |
d = {
|
69 |
"chunk_id": id,
|
70 |
"content_with_weight": rmSpace(sres.highlight[id]) if question and id in sres.highlight else sres.field[
|
|
|
60 |
sres = settings.retrievaler.search(query, search.index_name(tenant_id), kb_ids, highlight=True)
|
61 |
res = {"total": sres.total, "chunks": [], "doc": doc.to_dict()}
|
62 |
for id in sres.ids:
|
|
|
|
|
|
|
|
|
|
|
63 |
d = {
|
64 |
"chunk_id": id,
|
65 |
"content_with_weight": rmSpace(sres.highlight[id]) if question and id in sres.highlight else sres.field[
|