From c373dba0bc3f1d4593e53b0350abc65873ebb6ac Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 23 Dec 2024 18:59:48 +0800 Subject: [PATCH] Fix raptor bug. (#4192) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/nlp/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/nlp/search.py b/rag/nlp/search.py index 39fbc0150..3fef12c9d 100644 --- a/rag/nlp/search.py +++ b/rag/nlp/search.py @@ -383,8 +383,8 @@ class Dealer: res = [] bs = 128 for p in range(0, max_count, bs): - res = self.dataStore.search(fields, [], condition, [], OrderByExpr(), p, bs, index_name(tenant_id), kb_ids) - dict_chunks = self.dataStore.getFields(res, fields) + es_res = self.dataStore.search(fields, [], condition, [], OrderByExpr(), p, bs, index_name(tenant_id), kb_ids) + dict_chunks = self.dataStore.getFields(es_res, fields) if dict_chunks: res.extend(dict_chunks.values()) if len(dict_chunks.values()) < bs: