未验证 提交 c81bdda5 编写于 作者: C cai.zhang 提交者: GitHub

Hide autoindex params details (#24851) (#24935)

Signed-off-by: Nzhenshan.cao <zhenshan.cao@zilliz.com>
Co-authored-by: Nzhenshan.cao <zhenshan.cao@zilliz.com>
上级 a5192133
......@@ -496,7 +496,10 @@ func (dit *describeIndexTask) Execute(ctx context.Context) error {
}
params := indexInfo.GetUserIndexParams()
if params == nil {
params = indexInfo.GetIndexParams()
metricType, err := funcutil.GetAttrByKeyFromRepeatedKV(MetricTypeKey, indexInfo.GetIndexParams())
if err == nil {
params = wrapUserIndexParams(metricType)
}
}
desc := &milvuspb.IndexDescription{
IndexName: indexInfo.GetIndexName(),
......
......@@ -104,6 +104,10 @@ func TestGetAttrByKeyFromRepeatedKV(t *testing.T) {
assert.Equal(t, test.value, value)
assert.Equal(t, test.errIsNil, err == nil)
}
value, err := GetAttrByKeyFromRepeatedKV("key1", nil)
assert.Equal(t, "", value)
assert.Error(t, err)
}
func TestCheckCtxValid(t *testing.T) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册