mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
enhance: make range search param check message more meaningful (#32006)
Issue: #31970 Signed-off-by: Cai Yudong <yudong.cai@zilliz.com>
This commit is contained in:
parent
177ddda47f
commit
a0a4ec8b67
@ -120,14 +120,16 @@ CheckRangeSearchParam(float radius,
|
||||
*/
|
||||
if (PositivelyRelated(metric_type)) {
|
||||
AssertInfo(range_filter > radius,
|
||||
"range_filter({}) must be greater than radius({}) for "
|
||||
"IP/COSINE",
|
||||
"metric type ({}), range_filter({}) must be greater than "
|
||||
"radius({})",
|
||||
metric_type.c_str(),
|
||||
range_filter,
|
||||
radius);
|
||||
} else {
|
||||
AssertInfo(range_filter < radius,
|
||||
"range_filter({}) must be less than radius({}) for "
|
||||
"L2/HAMMING/JACCARD",
|
||||
"metric type ({}), range_filter({}) must be less than "
|
||||
"radius({})",
|
||||
metric_type.c_str(),
|
||||
range_filter,
|
||||
radius);
|
||||
}
|
||||
|
@ -981,12 +981,12 @@ func checkRangeSearchParams(str string, metricType string) error {
|
||||
|
||||
if metric.PositivelyRelated(metricType) {
|
||||
if params.radius >= params.rangeFilter {
|
||||
msg := fmt.Sprintf("range_filter must be greater than radius for IP/COSINE, range_filter:%f, radius:%f", params.rangeFilter, params.radius)
|
||||
msg := fmt.Sprintf("metric type '%s', range_filter(%f) must be greater than radius(%f)", metricType, params.rangeFilter, params.radius)
|
||||
return merr.WrapErrParameterInvalidMsg(msg)
|
||||
}
|
||||
} else {
|
||||
if params.radius <= params.rangeFilter {
|
||||
msg := fmt.Sprintf("range_filter must be less than radius for L2/HAMMING/JACCARD, range_filter:%f, radius:%f", params.rangeFilter, params.radius)
|
||||
msg := fmt.Sprintf("metric type '%s', range_filter(%f) must be less than radius(%f)", metricType, params.rangeFilter, params.radius)
|
||||
return merr.WrapErrParameterInvalidMsg(msg)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user