Commit 9405fc17 authored by jyong's avatar jyong

add rerank

parent d38eac95
......@@ -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']
......
......@@ -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']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment