-
Notifications
You must be signed in to change notification settings - Fork 23
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
Can Support 2.3.x Range Search? #245
Comments
How about for having a workaround by set top to a large number, e.g arguments.SetTopK(...) before do search. |
if set topk set to a larger number, 10, then the result count is always 10,and some of the distances do not meet the requirements of range search. It seems that only topk plays a role. |
@regain0001 you could try latest master code, it should be fixed by #248 |
thanks |
Through the latest documentation of 2.3.x, I found that milvus itself supports range search, but when I tried to use cpp sdk for range query, I found that it did not work.
My query code is as follows:
// index use HNSW
// metric type is IP
milvus::SearchArguments arguments{};
arguments.SetCollectionName(collection_name);
vectorq_vector {0.1, 0.8, 0.1, 0.1};
arguments.SetGuaranteeTimestamp(milvus::GuaranteeStrongTs());
arguments.AddTargetVector(faceField, std::move(q_vector));
arguments.SetMetricType(milvus::MetricType::IP);
arguments.AddExtraParam("radius", 0.2);
arguments.AddExtraParam("range_filter", 10.0);
arguments.AddExtraParam("ef", 10);
arguments.AddOutputField(trackIdField);
int64_t topk = arguments.TopK();
cout << "topk:" << topk << endl;
milvus::SearchResults search_results{};
status = client->Search(arguments, search_results);
I has two entities both distance within target vector is between 0.2 and 10.0,but the search result is always one,
topk output is 1,So I doubt if the default topk parameter will affect the results (according to the documentation for range queries, the topk parameter is not required for range queries)。
The text was updated successfully, but these errors were encountered: