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

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
Co-authored-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/24880/head
cai.zhang 2023-06-16 14:30:40 +08:00 committed by GitHub
parent a519213316
commit c81bdda55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -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(),

View File

@ -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) {