Ignore exceptions when no index ahead. (#5047)

### What problem does this PR solve?

### Type of change

- [x] Refactoring
This commit is contained in:
Kevin Hu
2025-02-18 09:09:22 +08:00
committed by GitHub
parent 7b5d831296
commit 9ff825f39d
2 changed files with 3 additions and 1 deletions

View File

@ -449,6 +449,8 @@ 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]):
return []
res = self.dataStore.search([], [], {}, [], OrderByExpr(), 0, 0, index_name(tenant_id), kb_ids, ["tag_kwd"])
return self.dataStore.getAggregation(res, "tag_kwd")