From ae4ed109718d754154457042b87acb6e3845bf27 Mon Sep 17 00:00:00 2001 From: jyong Date: Thu, 21 Sep 2023 04:52:32 +0800 Subject: [PATCH] qdrant migrate issue --- api/core/index/vector_index/qdrant_vector_index.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/core/index/vector_index/qdrant_vector_index.py b/api/core/index/vector_index/qdrant_vector_index.py index 22082499e2fe06..732a10b0ae2471 100644 --- a/api/core/index/vector_index/qdrant_vector_index.py +++ b/api/core/index/vector_index/qdrant_vector_index.py @@ -169,6 +169,20 @@ def delete_by_group_id(self, group_id: str) -> None: ], )) + def delete(self) -> None: + vector_store = self._get_vector_store() + vector_store = cast(self._get_vector_store_class(), vector_store) + + from qdrant_client.http import models + vector_store.del_texts(models.Filter( + must=[ + models.FieldCondition( + key="group_id", + match=models.MatchValue(value=self.dataset.id), + ), + ], + )) + def _is_origin(self): if self.dataset.index_struct_dict: class_prefix: str = self.dataset.index_struct_dict['vector_store']['class_prefix']