diff --git a/internal/core/src/common/RangeSearchHelper.cpp b/internal/core/src/common/RangeSearchHelper.cpp index b2d49597d4..05250ce42a 100644 --- a/internal/core/src/common/RangeSearchHelper.cpp +++ b/internal/core/src/common/RangeSearchHelper.cpp @@ -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); } diff --git a/internal/proxy/task_search.go b/internal/proxy/task_search.go index f6a1b66d6c..269cf84f9d 100644 --- a/internal/proxy/task_search.go +++ b/internal/proxy/task_search.go @@ -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) } }