mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 22:45:26 +08:00
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
package reader
|
|
|
|
import (
|
|
"context"
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb"
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
|
|
msgpb "github.com/zilliztech/milvus-distributed/internal/proto/message"
|
|
)
|
|
|
|
type ResultEntityIds []int64
|
|
|
|
type SearchResult struct {
|
|
ResultIds []int64
|
|
ResultDistances []float32
|
|
}
|
|
|
|
func (node *QueryNode) PublishSearchResult(results *msgpb.QueryResult) commonpb.Status {
|
|
var ctx = context.Background()
|
|
|
|
node.messageClient.SendResult(ctx, *results, results.ProxyId)
|
|
|
|
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
|
|
}
|
|
|
|
func (node *QueryNode) PublishFailedSearchResult() commonpb.Status {
|
|
var results = msgpb.QueryResult{
|
|
}
|
|
|
|
var ctx = context.Background()
|
|
|
|
node.messageClient.SendResult(ctx, results, results.ProxyId)
|
|
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
|
|
}
|
|
|
|
func (node *QueryNode) PublicStatistic(statisticData *[]internalpb.SegmentStatistics) commonpb.Status {
|
|
var ctx = context.Background()
|
|
|
|
node.messageClient.SendSegmentsStatistic(ctx, statisticData)
|
|
|
|
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
|
|
}
|