diff --git a/internal/proxy/task_index.go b/internal/proxy/task_index.go index 3b69f59d4a4bb..914b752807980 100644 --- a/internal/proxy/task_index.go +++ b/internal/proxy/task_index.go @@ -473,7 +473,7 @@ func checkTrain(field *schemapb.FieldSchema, indexParams map[string]string) erro if typeutil.IsVectorType(field.DataType) && indexType != indexparamcheck.AutoIndex { exist := CheckVecIndexWithDataTypeExist(indexType, field.DataType) if !exist { - return fmt.Errorf("data type %d can't build with this index %s", field.DataType, indexType) + return fmt.Errorf("data type %s can't build with this index %s", schemapb.DataType_name[int32(field.GetDataType())], indexType) } } diff --git a/tests/go_client/testcases/index_test.go b/tests/go_client/testcases/index_test.go index cb85e4236fade..ae0747a1636ca 100644 --- a/tests/go_client/testcases/index_test.go +++ b/tests/go_client/testcases/index_test.go @@ -864,7 +864,7 @@ func TestCreateSparseUnsupportedIndex(t *testing.T) { // create unsupported vector index on sparse field for _, idx := range hp.GenAllFloatIndex(entity.IP) { _, err := mc.CreateIndex(ctx, client.NewCreateIndexOption(schema.CollectionName, common.DefaultSparseVecFieldName, idx)) - common.CheckErr(t, err, false, fmt.Sprintf("data type 104 can't build with this index %v", idx.IndexType())) + common.CheckErr(t, err, false, fmt.Sprintf("data type SparseFloatVector can't build with this index %v", idx.IndexType())) } // create scalar index on sparse vector