mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-09-25 08:04:49 +00:00
Fix behavior of delete_documents() with filters for Milvus (#1354)
* Fix behavior of delete_documents() Delete filtered set of vectors rather than the whole collection * Update milvus.py * Update milvus.py
This commit is contained in:
parent
51f0a56e5d
commit
4ca97dd5be
@ -403,6 +403,10 @@ class MilvusDocumentStore(SQLDocumentStore):
|
||||
if status.code != Status.SUCCESS:
|
||||
raise RuntimeError(f'Milvus has collection check failed: {status}')
|
||||
if ok:
|
||||
if filters:
|
||||
existing_docs = super().get_all_documents(filters=filters, index=index)
|
||||
self._delete_vector_ids_from_milvus(documents=existing_docs, index=index)
|
||||
else:
|
||||
status = self.milvus_server.drop_collection(collection_name=index)
|
||||
if status.code != Status.SUCCESS:
|
||||
raise RuntimeError(f'Milvus drop collection failed: {status}')
|
||||
|
Loading…
x
Reference in New Issue
Block a user