From 7248e98b9edba60a34e8b0018e7b5c1ee1bbdc76 Mon Sep 17 00:00:00 2001 From: Hasan <94289705+hasansustcse13@users.noreply.github.com> Date: Thu, 22 Feb 2024 07:03:50 +0600 Subject: [PATCH] community[patch]: Return PK in similarity search Document (#17561) Issue: #17390 Co-authored-by: hasan --- libs/community/langchain_community/vectorstores/milvus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/vectorstores/milvus.py b/libs/community/langchain_community/vectorstores/milvus.py index 1423b32012..635f165ed2 100644 --- a/libs/community/langchain_community/vectorstores/milvus.py +++ b/libs/community/langchain_community/vectorstores/milvus.py @@ -739,8 +739,8 @@ class Milvus(VectorStore): if param is None: param = self.search_params - # Determine result metadata fields. - output_fields = [x for x in self.fields if x != self._primary_field] + # Determine result metadata fields with PK. + output_fields = self.fields[:] output_fields.remove(self._vector_field) # Perform the search.