mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 03:18:29 +08:00
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
parent
37e6398ed6
commit
6d92b8499c
@ -68,8 +68,8 @@ Search(CSegmentInterface c_segment,
|
||||
auto plan = (milvus::query::Plan*)c_plan;
|
||||
auto phg_ptr = reinterpret_cast<const milvus::query::PlaceholderGroup*>(c_placeholder_group);
|
||||
*search_result = segment->Search(plan, *phg_ptr, timestamp);
|
||||
// if (plan->plan_node_->search_info_.metric_type_ != milvus::MetricType::METRIC_INNER_PRODUCT) {
|
||||
if (!milvus::segcore::PositivelyRelated(plan->plan_node_->search_info_.metric_type_)) {
|
||||
if (plan->plan_node_->search_info_.metric_type_ != milvus::MetricType::METRIC_INNER_PRODUCT) {
|
||||
// if (!milvus::segcore::PositivelyRelated(plan->plan_node_->search_info_.metric_type_)) {
|
||||
for (auto& dis : search_result->distances_) {
|
||||
dis *= -1;
|
||||
}
|
||||
|
@ -30,8 +30,6 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/distance"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
@ -1833,8 +1831,8 @@ func reduceSearchResultData(searchResultData []*schemapb.SearchResultData, nq in
|
||||
log.Debug("skip duplicated search result", zap.Int64("count", skipDupCnt))
|
||||
ret.Results.TopK = realTopK
|
||||
|
||||
// if metricType != "IP" {
|
||||
if !distance.PositivelyRelated(metricType) {
|
||||
if metricType != "IP" {
|
||||
// if !distance.PositivelyRelated(metricType) {
|
||||
for k := range ret.Results.Scores {
|
||||
ret.Results.Scores[k] *= -1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user