Skip to content

Commit

Permalink
Fix search result
Browse files Browse the repository at this point in the history
1. Print id instead of pk
2. Return the correct data type for future.result()

Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn committed Oct 23, 2023
1 parent ae3d445 commit 55e69ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pymilvus/client/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def get(self, field_name: str) -> Any:
return self.fields.get(field_name)

def __str__(self) -> str:
return f"pk: {self.id}, distance: {self.distance}, entity: {self.fields}"
return f"id: {self.id}, distance: {self.distance}, entity: {self.fields}"

__repr__ = __str__

Expand Down
5 changes: 3 additions & 2 deletions pymilvus/orm/future.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from typing import Any

from pymilvus.grpc_gen import schema_pb2
from pymilvus.client.abstract import SearchResult

from .mutation import MutationResult

Expand Down Expand Up @@ -43,8 +44,8 @@ def done(self):


class _EmptySearchFuture:
def result(self) -> schema_pb2.SearchResultData:
return schema_pb2.SearchResultData()
def result(self) -> SearchResult:
return SearchResult(schema_pb2.SearchResultData())

def cancel(self) -> None:
pass
Expand Down

0 comments on commit 55e69ea

Please sign in to comment.