milvus/reader/read_node/result.go
xige-16 615400127a Set default config in config.yaml
Signed-off-by: xige-16 <xi.ge@zilliz.com>
2020-09-23 19:51:14 +08:00

45 lines
1.1 KiB
Go

package reader
import (
"context"
masterPb "github.com/czs007/suvlim/pkg/master/grpc/master"
msgPb "github.com/czs007/suvlim/pkg/master/grpc/message"
)
type ResultEntityIds []int64
type SearchResult struct {
ResultIds []int64
ResultDistances []float32
}
func (node *QueryNode) PublishSearchResult(results *msgPb.QueryResult) msgPb.Status {
var ctx = context.Background()
node.messageClient.SendResult(ctx, *results, results.ClientId)
return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS}
}
func (node *QueryNode) PublishFailedSearchResult() msgPb.Status {
var results = msgPb.QueryResult{
Status: &msgPb.Status{
ErrorCode: 1,
Reason: "Search Failed",
},
}
var ctx = context.Background()
node.messageClient.SendResult(ctx, results, results.ClientId)
return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS}
}
func (node *QueryNode) PublicStatistic(statisticData *[]masterPb.SegmentStat) msgPb.Status {
var ctx = context.Background()
node.messageClient.SendSegmentsStatistic(ctx, statisticData)
return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS}
}