From 29a59ed7e273a47c5d0ba5e9c56ceb7e0037419c Mon Sep 17 00:00:00 2001 From: ubbg <73386138+ubbg@users.noreply.github.com> Date: Wed, 19 Feb 2025 04:50:57 +0100 Subject: [PATCH] Fix: Use self.dataStore.indexExist in all_tags method of Dealer (#5108) ### What problem does this PR solve? This PR fixes an AttributeError in the all_tags method of the Dealer class. Previously, the method incorrectly called self.docStoreConn.indexExist instead of self.dataStore.indexExist. Since self.docStoreConn was never set (and self.dataStore is already initialized in init), this resulted in an error when attempting to check if the index exists. This change ensures that the proper connector is used for the index existence check, thereby resolving the issue._ ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/nlp/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/nlp/search.py b/rag/nlp/search.py index 3580f2236..86b02d78d 100644 --- a/rag/nlp/search.py +++ b/rag/nlp/search.py @@ -449,7 +449,7 @@ class Dealer: return res def all_tags(self, tenant_id: str, kb_ids: list[str], S=1000): - if not self.docStoreConn.indexExist(index_name(tenant_id), kb_ids[0]): + if not self.dataStore.indexExist(index_name(tenant_id), kb_ids[0]): return [] res = self.dataStore.search([], [], {}, [], OrderByExpr(), 0, 0, index_name(tenant_id), kb_ids, ["tag_kwd"]) return self.dataStore.getAggregation(res, "tag_kwd")