mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: editing a knowledge file on Elasticsearch keeps its old text searchable
With VECTOR_DB=elasticsearch, changing a file's content in a knowledge base added the new text but never removed the old chunks, so searches and chats kept returning the old text next to the new. The old chunks are now found and removed after the edit, the same as on the default store. Fixes #31523
This commit is contained in:
parent
176d31d1db
commit
ebc8e81a3f
1 changed files with 2 additions and 2 deletions
|
|
@ -200,9 +200,9 @@ class ElasticsearchClient(VectorDBBase):
|
|||
}
|
||||
|
||||
for field, value in filter.items():
|
||||
query_body['query']['bool']['filter'].append({'term': {field: value}})
|
||||
query_body['query']['bool']['filter'].append({'term': {f'metadata.{field}': value}})
|
||||
query_body['query']['bool']['filter'].append({'term': {'collection': collection_name}})
|
||||
size = limit if limit else 10
|
||||
size = limit if limit else 10000
|
||||
|
||||
try:
|
||||
result = self.client.search(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue