From d15a9d205d030611ef5f48bb6989a1ed17d9e1d0 Mon Sep 17 00:00:00 2001 From: nameczz Date: Tue, 18 Jun 2024 16:56:02 +0800 Subject: [PATCH] feat: support show index for milvus2.4 Signed-off-by: nameczz --- milvus_cli/Index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/milvus_cli/Index.py b/milvus_cli/Index.py index 60b379c..6b1c123 100644 --- a/milvus_cli/Index.py +++ b/milvus_cli/Index.py @@ -50,14 +50,17 @@ def get_index_details( index = collection.index(index_name=indexName) if not index: return "No index!" + rows = [] rows.append(["Corresponding Collection", index.collection_name]) rows.append(["Corresponding Field", index.field_name]) rows.append(["Index Name", index.index_name]) + rows.append(["Index Type", index.params["index_type"]]) rows.append(["Metric Type", index.params["metric_type"]]) - params = index.params["params"] + params = index.params.get("params", {}) paramsDetails = "\n- ".join(map(lambda k: f"{k[0]}: {k[1]}", params.items())) + rows.append(["Params", paramsDetails]) return tabulate(rows, tablefmt="grid")