From 3abc9be1c271749dcc9e8874d6c621601255b8b1 Mon Sep 17 00:00:00 2001 From: dearjane <916684703@qq.com> Date: Wed, 28 Aug 2024 16:35:42 +0800 Subject: [PATCH] fix(graphrag): variable refernence error (#2136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What problem does this PR solve? fix: Use wrong variable in graph rag step. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: 陈晓强 --- graphrag/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphrag/search.py b/graphrag/search.py index 9a95a20a4..fb4453408 100644 --- a/graphrag/search.py +++ b/graphrag/search.py @@ -93,9 +93,9 @@ class KGSearch(Dealer): s = s.query(bqry)[0: 6] s = s.to_dict() txt_res = self.es.search(deepcopy(s), idxnm=idxnm, timeout="600s", src=src) - txt_ids = self.es.getDocIds(comm_res) + txt_ids = self.es.getDocIds(txt_res) if merge_into_first(txt_res, "-Original Content-"): - txt_ids = comm_ids[0:1] + txt_ids = txt_ids[0:1] return self.SearchResult( total=len(ent_ids) + len(comm_ids) + len(txt_ids),