fix: pass the ttl duration in the search request for ttl filter (#42122)

fix: pass the TTL duration in the search request for TTL filter
issue:https://github.com/milvus-io/milvus/issues/41959

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
Xianhui Lin 2025-05-28 11:08:29 +08:00 committed by GitHub
parent 7243c1d0ce
commit da30e1e4df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -251,6 +251,7 @@ func (sd *shardDelegator) shallowCopySearchRequest(req *internalpb.SearchRequest
FieldId: req.FieldId,
IsTopkReduce: req.IsTopkReduce,
IsRecallEvaluation: req.IsRecallEvaluation,
CollectionTtlTimestamps: req.CollectionTtlTimestamps,
}
return nodeReq
@ -429,6 +430,7 @@ func (sd *shardDelegator) Search(ctx context.Context, req *querypb.SearchRequest
FieldId: subReq.GetFieldId(),
IsTopkReduce: req.GetReq().GetIsTopkReduce(),
IsIterator: req.GetReq().GetIsIterator(),
CollectionTtlTimestamps: req.GetReq().GetCollectionTtlTimestamps(),
}
future := conc.Go(func() (*internalpb.SearchResults, error) {
searchReq := &querypb.SearchRequest{
@ -441,7 +443,7 @@ func (sd *shardDelegator) Search(ctx context.Context, req *querypb.SearchRequest
if searchReq.GetReq().GetMvccTimestamp() == 0 {
searchReq.GetReq().MvccTimestamp = tSafe
}
searchReq.Req.CollectionTtlTimestamps = req.GetReq().GetCollectionTtlTimestamps()
results, err := sd.search(ctx, searchReq, sealed, growing)
if err != nil {
return nil, err