mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-05 22:33:24 +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}, ...]
|
# 获取 id 和 source , 格式:[{"id": str, "metadata": dict}, ...]
|
||||||
print("写入数据成功.")
|
print("写入数据成功.")
|
||||||
print("*"*100)
|
print("*"*100)
|
||||||
|
|
||||||
if self.es_client_python.indices.exists(index=self.index_name):
|
if self.es_client_python.indices.exists(index=self.index_name):
|
||||||
file_path = docs[0].metadata.get("source")
|
file_path = docs[0].metadata.get("source")
|
||||||
query = {
|
query = {
|
||||||
"query": {
|
"query": {
|
||||||
"term": {
|
"term": {
|
||||||
"metadata.source.keyword": file_path
|
"metadata.source.keyword": file_path
|
||||||
|
},
|
||||||
|
"term": {
|
||||||
|
"_index": self.index_name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user