From d5750cce624faedffa51a0920f59eb18e29eb78c Mon Sep 17 00:00:00 2001 From: Cai Zhang Date: Tue, 25 Jun 2024 14:55:52 +0800 Subject: [PATCH] Export indexed rows for descrieb_index Signed-off-by: Cai Zhang --- client/index.go | 4 ++++ client/index_test.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/client/index.go b/client/index.go index 97d3ef774..b5c81a347 100644 --- a/client/index.go +++ b/client/index.go @@ -199,6 +199,10 @@ func (c *GrpcClient) DescribeIndex(ctx context.Context, collName string, fieldNa } params := entity.KvPairsMap(info.Params) it := params["index_type"] // TODO change to const + params["total_rows"] = strconv.FormatInt(info.GetTotalRows(), 10) + params["indexed_rows"] = strconv.FormatInt(info.GetIndexedRows(), 10) + params["pending_index_rows"] = strconv.FormatInt(info.GetPendingIndexRows(), 10) + params["state"] = info.GetState().String() idx := entity.NewGenericIndex( info.IndexName, entity.IndexType(it), diff --git a/client/index_test.go b/client/index_test.go index 323ef7c6a..60049143e 100644 --- a/client/index_test.go +++ b/client/index_test.go @@ -117,6 +117,10 @@ func TestGrpcClientDescribeIndex(t *testing.T) { "nlist": "1024", "metric_type": "IP", }), + TotalRows: 10000, + IndexedRows: 4000, + PendingIndexRows: 10000, + State: commonpb.IndexState_InProgress, }, } s, err := SuccessStatus()