Переглянути джерело

Ignore exceptions when no index ahead. (#5047)

### What problem does this PR solve?

### Type of change

- [x] Refactoring
tags/v0.17.0
Kevin Hu 8 місяці тому
джерело
коміт
9ff825f39d
Аккаунт користувача з таким Email не знайдено
2 змінених файлів з 3 додано та 1 видалено
  1. 1
    1
      api/apps/kb_app.py
  2. 2
    0
      rag/nlp/search.py

+ 1
- 1
api/apps/kb_app.py Переглянути файл

@@ -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):

+ 2
- 0
rag/nlp/search.py Переглянути файл

@@ -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")


Завантаження…
Відмінити
Зберегти