@@ -517,7 +517,7 @@ async def delete_documents_async(self, document_ids: list[str]) -> None:
517517 "Called QdrantDocumentStore.delete_documents_async() on a non-existing ID" ,
518518 )
519519
520- def delete_by_filter (self , filters : dict [str , Any ]) -> int :
520+ def delete_by_filter (self , filters : dict [str , Any ]) -> None :
521521 """
522522 Deletes all documents that match the provided filters.
523523
@@ -532,15 +532,8 @@ def delete_by_filter(self, filters: dict[str, Any]) -> int:
532532
533533 try :
534534 qdrant_filter = convert_filters_to_qdrant (filters )
535-
536535 if qdrant_filter is None :
537- return 0
538-
539- matching_docs = list (self .filter_documents (filters ))
540- count = len (matching_docs )
541-
542- if count == 0 :
543- return 0
536+ return
544537
545538 # perform deletion using FilterSelector
546539 self ._client .delete (
@@ -549,17 +542,11 @@ def delete_by_filter(self, filters: dict[str, Any]) -> int:
549542 wait = self .wait_result_from_api ,
550543 )
551544
552- logger .info (
553- "Deleted {n_docs} documents from collection '{name}' using filters." ,
554- n_docs = count ,
555- name = self .index ,
556- )
557- return count
558545 except Exception as e :
559546 msg = f"Failed to delete documents by filter from Qdrant: { e !s} "
560547 raise QdrantStoreError (msg ) from e
561548
562- async def delete_by_filter_async (self , filters : dict [str , Any ]) -> int :
549+ async def delete_by_filter_async (self , filters : dict [str , Any ]) -> None :
563550 """
564551 Asynchronously deletes all documents that match the provided filters.
565552
@@ -574,17 +561,8 @@ async def delete_by_filter_async(self, filters: dict[str, Any]) -> int:
574561
575562 try :
576563 qdrant_filter = convert_filters_to_qdrant (filters )
577-
578564 if qdrant_filter is None :
579- return 0
580-
581- matching_docs = []
582- async for doc in self ._get_documents_generator_async (filters ):
583- matching_docs .append (doc )
584- count = len (matching_docs )
585-
586- if count == 0 :
587- return 0
565+ return
588566
589567 # perform deletion using FilterSelector
590568 await self ._async_client .delete (
@@ -593,12 +571,6 @@ async def delete_by_filter_async(self, filters: dict[str, Any]) -> int:
593571 wait = self .wait_result_from_api ,
594572 )
595573
596- logger .info (
597- "Deleted {n_docs} documents from collection '{name}' using filters." ,
598- n_docs = count ,
599- name = self .index ,
600- )
601- return count
602574 except Exception as e :
603575 msg = f"Failed to delete documents by filter from Qdrant: { e !s} "
604576 raise QdrantStoreError (msg ) from e
0 commit comments