milvus-io / milvus-sdk-cpp

C++ SDK for Milvus 2.0
Apache License 2.0
35 stars 21 forks source link

Error: Assert "field_indexing->metric_type_ == search_info.metric_type_" #173

Closed Xiejiadong closed 2 years ago

Xiejiadong commented 2 years ago

I met an error when I try to use the change the code of the sample, the error is " Failed to search: no Available QueryNode result, filter reason [UnexpectedError] Assert "field_indexing->metrictype == search_info.metrictype" at /go/src/github.com/milvus-io/milvus/internal/core/src/query/SearchOnSealed.cpp:80".

Is it means the type of the targetvector of the search is not the same as the data?

xiaofan-luan commented 2 years ago

when you build index, you should use same metric_type as search do~

Xiejiadong commented 2 years ago

In fact, we use py to save and build the index, then we try to use C++ to search, and use vector<float>. I wonder how to solve this error. Thanks~

matrixji commented 2 years ago

In fact, we use py to save and build the index, then we try to use C++ to search, and use vector<float>. I wonder how to solve this error. Thanks~

You need to set the metric type for SearchArguments, which is not included in the sample code from milvus-sdk-cpp so far. Maybe the below code in the test is an example of how to set metric-type

https://github.com/milvus-io/milvus-sdk-cpp/blob/ac4812d015ce363f21281068a77efea8fc94cd9d/test/st/TestSearch.cpp#L157

matrixji commented 2 years ago

/close

sre-ci-robot commented 2 years ago

@matrixji: Closing this issue.

In response to [this](https://github.com/milvus-io/milvus-sdk-cpp/issues/173#issuecomment-1113157919): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.