Compare commits

...

1 Commits

Author SHA1 Message Date
jyong
9405fc17d3 add rerank 2023-09-28 10:17:27 +08:00
2 changed files with 19 additions and 0 deletions

View File

@@ -54,6 +54,10 @@ class BaseIndex(ABC):
def delete(self) -> None:
raise NotImplementedError
def search_by_full_text(self, query: str,
**kwargs: Any) -> List[Document]:
raise NotImplementedError
def _filter_duplicate_texts(self, texts: list[Document]) -> list[Document]:
for text in texts:
doc_id = text.metadata['doc_id']

View File

@@ -183,6 +183,21 @@ class QdrantVectorIndex(BaseVectorIndex):
],
))
def search_by_full_text(self, query: str,
**kwargs: Any) -> List[Document]:
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']