Skip to content

Commit

Permalink
Remove text field from milvus query for list/delete API (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-pranjald authored Nov 8, 2024
1 parent 19f5722 commit d92ca82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RAG/src/chain_server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def get_docs_vectorstore_langchain(vectorstore: VectorStore) -> List[str]:
elif settings.vector_store.name == "milvus":
# Getting all the ID's > 0
if vectorstore.col:
milvus_data = vectorstore.col.query(expr="pk >= 0", output_fields=["pk", "source", "text"])
milvus_data = vectorstore.col.query(expr="pk >= 0", output_fields=["pk", "source"])
filenames = set([extract_filename(metadata) for metadata in milvus_data])
return filenames
except Exception as e:
Expand Down Expand Up @@ -582,7 +582,7 @@ def del_docs_vectorstore_langchain(vectorstore: VectorStore, filenames: List[str
logger.info(f"Deleted documents with filenames {filename}")
elif settings.vector_store.name == "milvus":
# Getting all the ID's > 0
milvus_data = vectorstore.col.query(expr="pk >= 0", output_fields=["pk", "source", "text"])
milvus_data = vectorstore.col.query(expr="pk >= 0", output_fields=["pk", "source"])
for filename in filenames:
# get ids with filename in metadata
ids_list = [metadata["pk"] for metadata in milvus_data if extract_filename(metadata) == filename]
Expand Down

0 comments on commit d92ca82

Please sign in to comment.