mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-27 17:23:19 +08:00
修复es 知识库查询bug (#2848)
This commit is contained in:
parent
36956520ea
commit
9c5aa5bf2f
@ -214,13 +214,16 @@ class ESKBService(KBService):
|
||||
# 获取 id 和 source , 格式:[{"id": str, "metadata": dict}, ...]
|
||||
print("写入数据成功.")
|
||||
print("*"*100)
|
||||
|
||||
|
||||
if self.es_client_python.indices.exists(index=self.index_name):
|
||||
file_path = docs[0].metadata.get("source")
|
||||
query = {
|
||||
"query": {
|
||||
"term": {
|
||||
"metadata.source.keyword": file_path
|
||||
},
|
||||
"term": {
|
||||
"_index": self.index_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user