mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 10:58:15 -05:00
fix: editing a knowledge file on Elasticsearch keeps its old text searchable (#31530)
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user