From a928a47c4cbd7e2a9712a8279fa92e1a8a124938 Mon Sep 17 00:00:00 2001 From: alisalim17 Date: Sat, 13 Apr 2024 17:56:26 +0400 Subject: [PATCH] fix: replace file_url with doc_url --- vectordbs/qdrant.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/vectordbs/qdrant.py b/vectordbs/qdrant.py index 2be69597..4c667468 100644 --- a/vectordbs/qdrant.py +++ b/vectordbs/qdrant.py @@ -45,7 +45,7 @@ async def convert_to_rerank_format(self, chunks: List[rest.PointStruct]): { "content": chunk.payload.get("content"), "page_label": chunk.payload.get("page_label"), - "file_url": chunk.payload.get("file_url"), + "doc_url": chunk.payload.get("doc_url"), } for chunk in chunks ] @@ -92,22 +92,12 @@ async def query(self, input: str, top_k: int = MAX_QUERY_TOP_K) -> List: ] async def delete(self, file_url: str) -> None: - # client.count( - # collection_name="{collection_name}", - # count_filter=models.Filter( - # must=[ - # models.FieldCondition(key="color", match=models.MatchValue(value="red")), - # ] - # ), - # exact=True, - # ) - deleted_chunks = self.client.count( collection_name=self.index_name, count_filter=rest.Filter( must=[ rest.FieldCondition( - key="file_url", match=rest.MatchValue(value=file_url) + key="doc_url", match=rest.MatchValue(value=file_url) ) ] ), @@ -120,7 +110,7 @@ async def delete(self, file_url: str) -> None: filter=rest.Filter( must=[ rest.FieldCondition( - key="file_url", match=rest.MatchValue(value=file_url) + key="doc_url", match=rest.MatchValue(value=file_url) ) ] )