Skip to content

Commit

Permalink
Change text pk by using the parameter primary_field
Browse files Browse the repository at this point in the history
  • Loading branch information
HoaNQ9 committed Feb 2, 2024
1 parent fd26430 commit 6927e81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/community/langchain_community/vectorstores/milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,14 +1012,14 @@ def get_ids(self,
try:
query_result = self.col.query(
expr=expr,
output_fields=["pk"]
output_fields=[self._primary_field]
)
except MilvusException as exc:
logger.error(
"Failed to get ids: %s error: %s", self.collection_name, exc
)
raise exc
ids = [item.get("pk") for item in query_result]
ids = [item.get(self._primary_field) for item in query_result]
return ids

def upsert(self,
Expand Down

0 comments on commit 6927e81

Please sign in to comment.