2023-03-27 00:42:00 +08:00
|
|
|
package tasks
|
|
|
|
|
2023-07-03 18:24:25 +08:00
|
|
|
// TODO: rename this file into search_task.go
|
|
|
|
|
2023-03-27 00:42:00 +08:00
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2023-07-03 18:24:25 +08:00
|
|
|
"strconv"
|
2023-03-27 00:42:00 +08:00
|
|
|
|
2023-04-14 18:18:29 +08:00
|
|
|
"github.com/golang/protobuf/proto"
|
2024-04-10 15:07:17 +08:00
|
|
|
"github.com/samber/lo"
|
2024-01-25 16:59:00 +08:00
|
|
|
"go.opentelemetry.io/otel"
|
|
|
|
"go.opentelemetry.io/otel/trace"
|
2023-04-06 19:14:32 +08:00
|
|
|
"go.uber.org/zap"
|
|
|
|
|
2023-06-09 01:28:37 +08:00
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
|
2023-03-27 00:42:00 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/querypb"
|
2023-06-08 17:24:36 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/querynodev2/collector"
|
2023-03-27 00:42:00 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/querynodev2/segments"
|
2023-04-06 19:14:32 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/log"
|
|
|
|
"github.com/milvus-io/milvus/pkg/metrics"
|
|
|
|
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
2023-09-04 09:57:09 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/util/merr"
|
2023-06-08 17:24:36 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/util/metricsinfo"
|
2023-04-06 19:14:32 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
|
|
|
"github.com/milvus-io/milvus/pkg/util/timerecord"
|
2024-01-25 16:59:00 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
2023-03-27 00:42:00 +08:00
|
|
|
)
|
|
|
|
|
2023-07-03 18:24:25 +08:00
|
|
|
var (
|
|
|
|
_ Task = &SearchTask{}
|
|
|
|
_ MergeTask = &SearchTask{}
|
|
|
|
)
|
2023-03-27 00:42:00 +08:00
|
|
|
|
|
|
|
type SearchTask struct {
|
2023-04-14 18:18:29 +08:00
|
|
|
ctx context.Context
|
|
|
|
collection *segments.Collection
|
|
|
|
segmentManager *segments.Manager
|
|
|
|
req *querypb.SearchRequest
|
|
|
|
result *internalpb.SearchResults
|
2023-06-16 16:02:39 +08:00
|
|
|
merged bool
|
|
|
|
groupSize int64
|
2023-04-14 18:18:29 +08:00
|
|
|
topk int64
|
|
|
|
nq int64
|
|
|
|
placeholderGroup []byte
|
|
|
|
originTopks []int64
|
|
|
|
originNqs []int64
|
|
|
|
others []*SearchTask
|
|
|
|
notifier chan error
|
2024-02-21 11:54:53 +08:00
|
|
|
serverID int64
|
2023-04-03 15:24:24 +08:00
|
|
|
|
2024-01-25 16:59:00 +08:00
|
|
|
tr *timerecord.TimeRecorder
|
|
|
|
scheduleSpan trace.Span
|
2023-03-27 00:42:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSearchTask(ctx context.Context,
|
|
|
|
collection *segments.Collection,
|
|
|
|
manager *segments.Manager,
|
|
|
|
req *querypb.SearchRequest,
|
2024-02-21 11:54:53 +08:00
|
|
|
serverID int64,
|
2023-03-27 00:42:00 +08:00
|
|
|
) *SearchTask {
|
2024-01-25 16:59:00 +08:00
|
|
|
ctx, span := otel.Tracer(typeutil.QueryNodeRole).Start(ctx, "schedule")
|
2023-03-27 00:42:00 +08:00
|
|
|
return &SearchTask{
|
2023-04-14 18:18:29 +08:00
|
|
|
ctx: ctx,
|
|
|
|
collection: collection,
|
|
|
|
segmentManager: manager,
|
|
|
|
req: req,
|
2023-06-16 16:02:39 +08:00
|
|
|
merged: false,
|
|
|
|
groupSize: 1,
|
2023-04-14 18:18:29 +08:00
|
|
|
topk: req.GetReq().GetTopk(),
|
|
|
|
nq: req.GetReq().GetNq(),
|
|
|
|
placeholderGroup: req.GetReq().GetPlaceholderGroup(),
|
|
|
|
originTopks: []int64{req.GetReq().GetTopk()},
|
|
|
|
originNqs: []int64{req.GetReq().GetNq()},
|
|
|
|
notifier: make(chan error, 1),
|
2023-06-15 14:24:38 +08:00
|
|
|
tr: timerecord.NewTimeRecorderWithTrace(ctx, "searchTask"),
|
2024-01-25 16:59:00 +08:00
|
|
|
scheduleSpan: span,
|
2024-02-21 11:54:53 +08:00
|
|
|
serverID: serverID,
|
2023-03-27 00:42:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-03 18:24:25 +08:00
|
|
|
// Return the username which task is belong to.
|
|
|
|
// Return "" if the task do not contain any user info.
|
|
|
|
func (t *SearchTask) Username() string {
|
|
|
|
return t.req.Req.GetUsername()
|
|
|
|
}
|
|
|
|
|
2024-02-21 11:54:53 +08:00
|
|
|
func (t *SearchTask) GetNodeID() int64 {
|
|
|
|
return t.serverID
|
|
|
|
}
|
|
|
|
|
2024-01-04 17:50:46 +08:00
|
|
|
func (t *SearchTask) IsGpuIndex() bool {
|
|
|
|
return t.collection.IsGpuIndex()
|
|
|
|
}
|
|
|
|
|
2023-06-08 17:24:36 +08:00
|
|
|
func (t *SearchTask) PreExecute() error {
|
2023-07-03 18:24:25 +08:00
|
|
|
// Update task wait time metric before execute
|
2024-02-21 11:54:53 +08:00
|
|
|
nodeID := strconv.FormatInt(t.GetNodeID(), 10)
|
2023-07-03 18:24:25 +08:00
|
|
|
inQueueDuration := t.tr.ElapseSpan()
|
2024-04-10 10:55:17 +08:00
|
|
|
inQueueDurationMS := inQueueDuration.Seconds() * 1000
|
2023-07-03 18:24:25 +08:00
|
|
|
|
|
|
|
// Update in queue metric for prometheus.
|
|
|
|
metrics.QueryNodeSQLatencyInQueue.WithLabelValues(
|
|
|
|
nodeID,
|
2024-04-10 10:55:17 +08:00
|
|
|
metrics.SearchLabel,
|
|
|
|
t.collection.GetDBName(),
|
|
|
|
t.collection.GetResourceGroup(),
|
|
|
|
// TODO: resource group and db name may be removed at runtime,
|
|
|
|
// should be refactor into metricsutil.observer in the future.
|
|
|
|
).Observe(inQueueDurationMS)
|
2023-07-03 18:24:25 +08:00
|
|
|
|
|
|
|
username := t.Username()
|
|
|
|
metrics.QueryNodeSQPerUserLatencyInQueue.WithLabelValues(
|
|
|
|
nodeID,
|
|
|
|
metrics.SearchLabel,
|
|
|
|
username).
|
2024-04-10 10:55:17 +08:00
|
|
|
Observe(inQueueDurationMS)
|
2023-07-03 18:24:25 +08:00
|
|
|
|
|
|
|
// Update collector for query node quota.
|
|
|
|
collector.Average.Add(metricsinfo.SearchQueueMetric, float64(inQueueDuration.Microseconds()))
|
|
|
|
|
|
|
|
// Execute merged task's PreExecute.
|
2023-06-08 17:24:36 +08:00
|
|
|
for _, subTask := range t.others {
|
|
|
|
err := subTask.PreExecute()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-03-27 00:42:00 +08:00
|
|
|
func (t *SearchTask) Execute() error {
|
|
|
|
log := log.Ctx(t.ctx).With(
|
|
|
|
zap.Int64("collectionID", t.collection.ID()),
|
|
|
|
zap.String("shard", t.req.GetDmlChannels()[0]),
|
|
|
|
)
|
2023-04-14 18:18:29 +08:00
|
|
|
|
2024-01-25 16:59:00 +08:00
|
|
|
if t.scheduleSpan != nil {
|
|
|
|
t.scheduleSpan.End()
|
|
|
|
}
|
2023-07-25 18:51:01 +08:00
|
|
|
tr := timerecord.NewTimeRecorderWithTrace(t.ctx, "SearchTask")
|
2023-06-15 14:24:38 +08:00
|
|
|
|
2023-03-27 00:42:00 +08:00
|
|
|
req := t.req
|
2024-04-09 11:33:17 +08:00
|
|
|
err := t.combinePlaceHolderGroups()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-12-27 16:10:47 +08:00
|
|
|
searchReq, err := segments.NewSearchRequest(t.ctx, t.collection, req, t.placeholderGroup)
|
2023-03-27 00:42:00 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer searchReq.Delete()
|
|
|
|
|
2023-08-16 18:38:17 +08:00
|
|
|
var (
|
|
|
|
results []*segments.SearchResult
|
|
|
|
searchedSegments []segments.Segment
|
|
|
|
)
|
2023-03-27 00:42:00 +08:00
|
|
|
if req.GetScope() == querypb.DataScope_Historical {
|
2023-08-16 18:38:17 +08:00
|
|
|
results, searchedSegments, err = segments.SearchHistorical(
|
2023-03-27 00:42:00 +08:00
|
|
|
t.ctx,
|
|
|
|
t.segmentManager,
|
|
|
|
searchReq,
|
|
|
|
req.GetReq().GetCollectionID(),
|
|
|
|
nil,
|
|
|
|
req.GetSegmentIDs(),
|
|
|
|
)
|
|
|
|
} else if req.GetScope() == querypb.DataScope_Streaming {
|
2023-08-16 18:38:17 +08:00
|
|
|
results, searchedSegments, err = segments.SearchStreaming(
|
2023-03-27 00:42:00 +08:00
|
|
|
t.ctx,
|
|
|
|
t.segmentManager,
|
|
|
|
searchReq,
|
|
|
|
req.GetReq().GetCollectionID(),
|
|
|
|
nil,
|
|
|
|
req.GetSegmentIDs(),
|
|
|
|
)
|
|
|
|
}
|
2023-08-16 18:38:17 +08:00
|
|
|
defer t.segmentManager.Segment.Unpin(searchedSegments)
|
2023-03-27 00:42:00 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer segments.DeleteSearchResults(results)
|
|
|
|
|
2024-01-28 15:33:02 +08:00
|
|
|
// plan.MetricType is accurate, though req.MetricType may be empty
|
|
|
|
metricType := searchReq.Plan().GetMetricType()
|
|
|
|
|
2023-03-27 00:42:00 +08:00
|
|
|
if len(results) == 0 {
|
2023-04-14 18:18:29 +08:00
|
|
|
for i := range t.originNqs {
|
|
|
|
var task *SearchTask
|
|
|
|
if i == 0 {
|
|
|
|
task = t
|
|
|
|
} else {
|
|
|
|
task = t.others[i-1]
|
|
|
|
}
|
|
|
|
|
|
|
|
task.result = &internalpb.SearchResults{
|
2023-08-09 11:37:15 +08:00
|
|
|
Base: &commonpb.MsgBase{
|
2024-02-21 11:54:53 +08:00
|
|
|
SourceID: t.GetNodeID(),
|
2023-08-09 11:37:15 +08:00
|
|
|
},
|
2023-10-11 21:01:35 +08:00
|
|
|
Status: merr.Success(),
|
2024-01-28 15:33:02 +08:00
|
|
|
MetricType: metricType,
|
2023-04-14 18:18:29 +08:00
|
|
|
NumQueries: t.originNqs[i],
|
|
|
|
TopK: t.originTopks[i],
|
|
|
|
SlicedOffset: 1,
|
|
|
|
SlicedNumCount: 1,
|
2023-06-15 14:24:38 +08:00
|
|
|
CostAggregation: &internalpb.CostAggregation{
|
2023-07-25 18:51:01 +08:00
|
|
|
ServiceTime: tr.ElapseSpan().Milliseconds(),
|
2023-06-15 14:24:38 +08:00
|
|
|
},
|
2023-04-14 18:18:29 +08:00
|
|
|
}
|
2023-03-27 00:42:00 +08:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-04-10 15:07:17 +08:00
|
|
|
relatedDataSize := lo.Reduce(searchedSegments, func(acc int64, seg segments.Segment, _ int) int64 {
|
|
|
|
return acc + seg.MemSize()
|
|
|
|
}, 0)
|
|
|
|
|
2023-07-25 18:51:01 +08:00
|
|
|
tr.RecordSpan()
|
2023-03-27 00:42:00 +08:00
|
|
|
blobs, err := segments.ReduceSearchResultsAndFillData(
|
2023-12-27 16:10:47 +08:00
|
|
|
t.ctx,
|
2023-03-27 00:42:00 +08:00
|
|
|
searchReq.Plan(),
|
|
|
|
results,
|
|
|
|
int64(len(results)),
|
2023-04-14 18:18:29 +08:00
|
|
|
t.originNqs,
|
|
|
|
t.originTopks,
|
2023-03-27 00:42:00 +08:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
log.Warn("failed to reduce search results", zap.Error(err))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer segments.DeleteSearchResultDataBlobs(blobs)
|
2023-09-19 14:53:22 +08:00
|
|
|
metrics.QueryNodeReduceLatency.WithLabelValues(
|
2024-02-21 11:54:53 +08:00
|
|
|
fmt.Sprint(t.GetNodeID()),
|
2023-09-19 14:53:22 +08:00
|
|
|
metrics.SearchLabel,
|
|
|
|
metrics.ReduceSegments).
|
|
|
|
Observe(float64(tr.RecordSpan().Milliseconds()))
|
2023-04-14 18:18:29 +08:00
|
|
|
for i := range t.originNqs {
|
2023-12-27 16:10:47 +08:00
|
|
|
blob, err := segments.GetSearchResultDataBlob(t.ctx, blobs, i)
|
2023-04-14 18:18:29 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
var task *SearchTask
|
|
|
|
if i == 0 {
|
|
|
|
task = t
|
|
|
|
} else {
|
|
|
|
task = t.others[i-1]
|
|
|
|
}
|
|
|
|
|
|
|
|
// Note: blob is unsafe because get from C
|
|
|
|
bs := make([]byte, len(blob))
|
|
|
|
copy(bs, blob)
|
2023-03-27 00:42:00 +08:00
|
|
|
|
2023-04-14 18:18:29 +08:00
|
|
|
task.result = &internalpb.SearchResults{
|
2023-08-09 11:37:15 +08:00
|
|
|
Base: &commonpb.MsgBase{
|
2024-02-21 11:54:53 +08:00
|
|
|
SourceID: t.GetNodeID(),
|
2023-08-09 11:37:15 +08:00
|
|
|
},
|
2023-10-11 21:01:35 +08:00
|
|
|
Status: merr.Success(),
|
2024-01-28 15:33:02 +08:00
|
|
|
MetricType: metricType,
|
2023-04-14 18:18:29 +08:00
|
|
|
NumQueries: t.originNqs[i],
|
|
|
|
TopK: t.originTopks[i],
|
|
|
|
SlicedBlob: bs,
|
|
|
|
SlicedOffset: 1,
|
|
|
|
SlicedNumCount: 1,
|
2023-06-15 14:24:38 +08:00
|
|
|
CostAggregation: &internalpb.CostAggregation{
|
2024-04-10 15:07:17 +08:00
|
|
|
ServiceTime: tr.ElapseSpan().Milliseconds(),
|
|
|
|
TotalRelatedDataSize: relatedDataSize,
|
2023-06-15 14:24:38 +08:00
|
|
|
},
|
2023-04-14 18:18:29 +08:00
|
|
|
}
|
2023-03-27 00:42:00 +08:00
|
|
|
}
|
2023-09-19 14:53:22 +08:00
|
|
|
|
2023-03-27 00:42:00 +08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *SearchTask) Merge(other *SearchTask) bool {
|
|
|
|
var (
|
2023-04-14 18:18:29 +08:00
|
|
|
nq = t.nq
|
|
|
|
topk = t.topk
|
2023-06-16 16:02:39 +08:00
|
|
|
otherNq = other.nq
|
|
|
|
otherTopk = other.topk
|
2023-03-27 00:42:00 +08:00
|
|
|
)
|
|
|
|
|
2023-04-27 18:26:35 +08:00
|
|
|
diffTopk := topk != otherTopk
|
2023-03-27 00:42:00 +08:00
|
|
|
pre := funcutil.Min(nq*topk, otherNq*otherTopk)
|
|
|
|
maxTopk := funcutil.Max(topk, otherTopk)
|
|
|
|
after := (nq + otherNq) * maxTopk
|
|
|
|
ratio := float64(after) / float64(pre)
|
|
|
|
|
|
|
|
// Check mergeable
|
|
|
|
if t.req.GetReq().GetDbID() != other.req.GetReq().GetDbID() ||
|
|
|
|
t.req.GetReq().GetCollectionID() != other.req.GetReq().GetCollectionID() ||
|
2024-01-09 11:38:48 +08:00
|
|
|
t.req.GetReq().GetMvccTimestamp() != other.req.GetReq().GetMvccTimestamp() ||
|
2023-03-27 00:42:00 +08:00
|
|
|
t.req.GetReq().GetDslType() != other.req.GetReq().GetDslType() ||
|
|
|
|
t.req.GetDmlChannels()[0] != other.req.GetDmlChannels()[0] ||
|
|
|
|
nq+otherNq > paramtable.Get().QueryNodeCfg.MaxGroupNQ.GetAsInt64() ||
|
2023-04-27 18:26:35 +08:00
|
|
|
diffTopk && ratio > paramtable.Get().QueryNodeCfg.TopKMergeRatio.GetAsFloat() ||
|
2023-03-27 00:42:00 +08:00
|
|
|
!funcutil.SliceSetEqual(t.req.GetReq().GetPartitionIDs(), other.req.GetReq().GetPartitionIDs()) ||
|
|
|
|
!funcutil.SliceSetEqual(t.req.GetSegmentIDs(), other.req.GetSegmentIDs()) ||
|
|
|
|
!bytes.Equal(t.req.GetReq().GetSerializedExprPlan(), other.req.GetReq().GetSerializedExprPlan()) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
// Merge
|
2023-06-16 16:02:39 +08:00
|
|
|
t.groupSize += other.groupSize
|
2023-04-14 18:18:29 +08:00
|
|
|
t.topk = maxTopk
|
|
|
|
t.nq += otherNq
|
2023-03-27 00:42:00 +08:00
|
|
|
t.originTopks = append(t.originTopks, other.originTopks...)
|
|
|
|
t.originNqs = append(t.originNqs, other.originNqs...)
|
|
|
|
t.others = append(t.others, other)
|
2023-06-16 16:02:39 +08:00
|
|
|
other.merged = true
|
2023-03-27 00:42:00 +08:00
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *SearchTask) Done(err error) {
|
2023-06-16 16:02:39 +08:00
|
|
|
if !t.merged {
|
2024-02-21 11:54:53 +08:00
|
|
|
metrics.QueryNodeSearchGroupSize.WithLabelValues(fmt.Sprint(t.GetNodeID())).Observe(float64(t.groupSize))
|
|
|
|
metrics.QueryNodeSearchGroupNQ.WithLabelValues(fmt.Sprint(t.GetNodeID())).Observe(float64(t.nq))
|
|
|
|
metrics.QueryNodeSearchGroupTopK.WithLabelValues(fmt.Sprint(t.GetNodeID())).Observe(float64(t.topk))
|
2023-03-27 00:42:00 +08:00
|
|
|
}
|
2023-07-03 18:24:25 +08:00
|
|
|
t.notifier <- err
|
2023-03-27 00:42:00 +08:00
|
|
|
for _, other := range t.others {
|
|
|
|
other.Done(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *SearchTask) Canceled() error {
|
|
|
|
return t.ctx.Err()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *SearchTask) Wait() error {
|
|
|
|
return <-t.notifier
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *SearchTask) Result() *internalpb.SearchResults {
|
2024-01-09 11:38:48 +08:00
|
|
|
if t.result != nil {
|
|
|
|
channelsMvcc := make(map[string]uint64)
|
|
|
|
for _, ch := range t.req.GetDmlChannels() {
|
|
|
|
channelsMvcc[ch] = t.req.GetReq().GetMvccTimestamp()
|
|
|
|
}
|
|
|
|
t.result.ChannelsMvcc = channelsMvcc
|
|
|
|
}
|
2023-03-27 00:42:00 +08:00
|
|
|
return t.result
|
|
|
|
}
|
|
|
|
|
2023-07-03 18:24:25 +08:00
|
|
|
func (t *SearchTask) NQ() int64 {
|
|
|
|
return t.nq
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *SearchTask) MergeWith(other Task) bool {
|
|
|
|
switch other := other.(type) {
|
|
|
|
case *SearchTask:
|
|
|
|
return t.Merge(other)
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2023-04-14 18:18:29 +08:00
|
|
|
// combinePlaceHolderGroups combine all the placeholder groups.
|
2024-04-09 11:33:17 +08:00
|
|
|
func (t *SearchTask) combinePlaceHolderGroups() error {
|
|
|
|
if len(t.others) == 0 {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
ret := &commonpb.PlaceholderGroup{}
|
|
|
|
if err := proto.Unmarshal(t.placeholderGroup, ret); err != nil {
|
|
|
|
return merr.WrapErrParameterInvalidMsg("invalid search vector placeholder: %v", err)
|
|
|
|
}
|
|
|
|
if len(ret.GetPlaceholders()) == 0 {
|
|
|
|
return merr.WrapErrParameterInvalidMsg("empty search vector is not allowed")
|
|
|
|
}
|
|
|
|
for _, t := range t.others {
|
|
|
|
x := &commonpb.PlaceholderGroup{}
|
|
|
|
if err := proto.Unmarshal(t.placeholderGroup, x); err != nil {
|
|
|
|
return merr.WrapErrParameterInvalidMsg("invalid search vector placeholder: %v", err)
|
2023-04-14 18:18:29 +08:00
|
|
|
}
|
2024-04-09 11:33:17 +08:00
|
|
|
if len(x.GetPlaceholders()) == 0 {
|
|
|
|
return merr.WrapErrParameterInvalidMsg("empty search vector is not allowed")
|
|
|
|
}
|
|
|
|
ret.Placeholders[0].Values = append(ret.Placeholders[0].Values, x.Placeholders[0].Values...)
|
2023-04-14 18:18:29 +08:00
|
|
|
}
|
2024-04-09 11:33:17 +08:00
|
|
|
t.placeholderGroup, _ = proto.Marshal(ret)
|
|
|
|
return nil
|
2023-04-14 18:18:29 +08:00
|
|
|
}
|