show index info while GetSegmentInfo (#26981)

according to QueryNode::GetSegmentInfo

Signed-off-by: PowderLi <min.li@zilliz.com>
pull/26142/head
PowderLi 2023-09-13 11:37:18 +08:00 committed by GitHub
parent 394c898b4c
commit c033580af4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,8 @@ package utils
import (
"time"
"github.com/milvus-io/milvus/pkg/util/paramtable"
"go.uber.org/zap"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
@ -47,6 +49,7 @@ func MergeMetaSegmentIntoSegmentInfo(info *querypb.SegmentInfo, segments ...*met
first := segments[0]
if info.GetSegmentID() == 0 {
*info = querypb.SegmentInfo{
NodeID: paramtable.GetNodeID(),
SegmentID: first.GetID(),
CollectionID: first.GetCollectionID(),
PartitionID: first.GetPartitionID(),
@ -54,6 +57,12 @@ func MergeMetaSegmentIntoSegmentInfo(info *querypb.SegmentInfo, segments ...*met
DmChannel: first.GetInsertChannel(),
NodeIds: make([]int64, 0),
SegmentState: commonpb.SegmentState_Sealed,
IndexInfos: make([]*querypb.FieldIndexInfo, 0),
}
for _, indexInfo := range first.IndexInfo {
info.IndexName = indexInfo.IndexName
info.IndexID = indexInfo.IndexID
info.IndexInfos = append(info.IndexInfos, indexInfo)
}
}