mirror of https://github.com/milvus-io/milvus.git
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com> Co-authored-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/24880/head
parent
a519213316
commit
c81bdda55a
|
@ -496,7 +496,10 @@ func (dit *describeIndexTask) Execute(ctx context.Context) error {
|
||||||
}
|
}
|
||||||
params := indexInfo.GetUserIndexParams()
|
params := indexInfo.GetUserIndexParams()
|
||||||
if params == nil {
|
if params == nil {
|
||||||
params = indexInfo.GetIndexParams()
|
metricType, err := funcutil.GetAttrByKeyFromRepeatedKV(MetricTypeKey, indexInfo.GetIndexParams())
|
||||||
|
if err == nil {
|
||||||
|
params = wrapUserIndexParams(metricType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
desc := &milvuspb.IndexDescription{
|
desc := &milvuspb.IndexDescription{
|
||||||
IndexName: indexInfo.GetIndexName(),
|
IndexName: indexInfo.GetIndexName(),
|
||||||
|
|
|
@ -104,6 +104,10 @@ func TestGetAttrByKeyFromRepeatedKV(t *testing.T) {
|
||||||
assert.Equal(t, test.value, value)
|
assert.Equal(t, test.value, value)
|
||||||
assert.Equal(t, test.errIsNil, err == nil)
|
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) {
|
func TestCheckCtxValid(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue