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

@ -301,7 +301,7 @@ def knowledge_graph(kb_id):
}
obj = {"graph": {}, "mind_map": {}}
if not settings.docStoreConn.indexExist(search.index_name(kb.tenant_id)):
if not settings.docStoreConn.indexExist(search.index_name(kb.tenant_id), kb_id):
return get_json_result(data=obj)
sres = settings.retrievaler.search(req, search.index_name(kb.tenant_id), [kb_id])
if not len(sres.ids):