Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fix default search_param in milvus.py #4683

Closed
wants to merge 1 commit into from

Conversation

hyunsir
Copy link

@hyunsir hyunsir commented Apr 17, 2023

Describe the bug
A bug in haystack/blob/main/haystack/document_stores/milvus.py.
In MilvusDocumentStore, search_param, line 167:
self.search_param = search_param or {"nprobe": 10}
And in line 433:
param={"metric_type": self.metric_type, **self.search_param},
query with milvus2 will give an error due to this incorrect parameter passing

Error message
ERROR:pymilvus.decorators:RPC error: [search], <MilvusException: (code=1, message=fail to search on all shard leaders, err=All attempts results:
attempt #1: UnexpectedError, error: fail to Search, QueryNode ID=14, reason=Search 14 failed, reason [UnexpectedError] Error in virtual knowhere::DatasetPtr knowhere::IVF_NM::Query(const DatasetPtr&, const Config&, faiss::BitsetView) at IndexIVF_NM.cpp:216: [json.exception.out_of_range. 403] key 'nprobe' not found err %!w()
attempt #2 canceled
)>, <Time:{'RPC start': '2023-04-17 10:19:17.569321', 'RPC error': '2023-04-17 10:19:17.987552'}>

Error Reason
According to https://milvus.io/docs/search.md , search_params = {"metric_type": "L2", "params": {"nprobe": 10}, "offset": 5}
But in line 433, it will be search_params = {"metric_type": "L2", "nprobe": 10}, if user uses default self.search_param

Method of correction
change line 433 into:
param={"metric_type": self.metric_type, "params": self.search_param},
or change line167 and related describe:
self.search_param = search_param or {"params":{"nprobe": 10}}

@hyunsir hyunsir requested a review from a team as a code owner April 17, 2023 06:08
@hyunsir hyunsir requested review from ZanSara and removed request for a team April 17, 2023 06:08
@hyunsir
Copy link
Author

hyunsir commented Apr 17, 2023

#4681

@ZanSara
Copy link
Contributor

ZanSara commented Apr 17, 2023

Hey @hyunsir! I'm sorry but we don't take contributions for Milvus at this time. MilvusDocumentStore is deprecated and will be removed in 1.17. https://docs.haystack.deepset.ai/v1.16-unstable/reference/document-store-api#milvusdocumentstore. I will close this PR.

@ZanSara ZanSara closed this Apr 17, 2023
@ZanSara ZanSara removed their request for review April 26, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants