Closed ThreadDao closed 3 months ago
- Milvus version:master-20240603-7a2127b0-amd64 - Deployment mode(standalone or cluster): - MQ type(rocksmq, pulsar or kafka): - SDK version(e.g. pymilvus v2.0.0rc2): go-sdk v2 - OS(Ubuntu or CentOS): - CPU/Memory: - GPU: - Others:
search outputfields * or vec field return []
case:
func TestSearch(t *testing.T) { ctx := hp.CreateContext(t, time.Second*common.DefaultTimeout) mc := createDefaultMilvusClient(ctx, t) cp := hp.NewCreateCollectionParams(hp.Int64Vec) _, schema := hp.CollPrepare.CreateCollection(ctx, t, mc, cp, hp.TNewFieldsOption(), hp.TNewSchemaOption()) log.Info("schema", zap.Any("schema", schema)) insertParams := hp.NewInsertParams(schema, common.DefaultNb) hp.CollPrepare.InsertData(ctx, t, mc, insertParams, hp.TNewDataOption()) // flush -> index -> load hp.CollPrepare.FlushData(ctx, t, mc, schema.CollectionName) hp.CollPrepare.CreateIndex(ctx, t, mc, hp.NewIndexParams(schema)) hp.CollPrepare.Load(ctx, t, mc, hp.NewLoadParams(schema.CollectionName)) // search vectors := hp.GenSearchVectors(common.DefaultNq, common.DefaultDim, entity.FieldTypeFloatVector) resSearch, err := mc.Search(ctx, clientv2.NewSearchOption(schema.CollectionName, common.DefaultLimit, vectors).WithConsistencyLevel(entity.ClStrong).WithOutputFields([]string{"*"})) common.CheckErr(t, err, true) common.CheckSearchResult(t, resSearch, common.DefaultNq, common.DefaultLimit) log.Info("search", zap.Any("resSearch", resSearch)) log.Info("search", zap.Any("ids", resSearch[0].IDs)) log.Info("search", zap.Any("scores", resSearch[0].Scores)) id, _ := resSearch[0].IDs.GetAsInt64(0) log.Info("search", zap.Int64("ids", id)) for _, column := range resSearch[0].Fields{ log.Debug("fields", zap.Any("fields",column.Name())) } }
[2024/06/05 12:04:03.145 +08:00] [INFO] [base/milvus_client.go:37] [Request] [method=Search] [reqs="{\"collection_name\":\"pre_KjXFUo\",\"placeholder_group\":\"CpUUCgIkMBBlGoAE9z7HPWkGxj5n4kI/tjR7P0N17z2+ZZg+8DkFPQXdVj8xNUE/xRAbP+ASHT+8v9w9v3bPPlVS1Tutz7A9VDI6P9RRAD9tQMM+NWd6P4FzOD9StZ0+BZu6PvUgiD4H8fk7cmNPPwQCRT/g9p8+aHpHP+l/FT/Cqg4/8Vb/PfU7lz06UFw/4vSyPfsKXz5fug8/EGllPvuBxj0SQho+9dfqPOLfEz+3RPw+p6EgP+P..."] [2024/06/05 12:04:03.470 +08:00] [INFO] [base/milvus_client.go:56] [Response] [method=Search] [resp="{\"status\":{},\"results\":{\"num_queries\":5,\"top_k\":10,\"scores\":[0.81696415,0.8165557,0.8161729,0.81391853,0.8124938,0.80727804,0.8065588,0.8054077,0.80232,0.80066717,0.8595648,0.84206176,0.82866615,0.82839096,0.8255365,0.8249576,0.8247805,0.8240897,0.8239025,0.8229659,0.83529603,0.8336815,0.8268861,0.8..."] [2024/06/05 12:04:03.470 +08:00] [DEBUG] [base/milvus_client.go:57] [Cost] [method=Search] [cost=325.075036ms] [2024/06/05 12:04:03.471 +08:00] [INFO] [testcases/search_test.go:37] [search] [resSearch="[{\"ResultCount\":10,\"GroupByValue\":null,\"IDs\":{},\"Fields\":[],\"Scores\":[0.81696415,0.8165557,0.8161729,0.81391853,0.8124938,0.80727804,0.8065588,0.8054077,0.80232,0.80066717],\"Err\":null},{\"ResultCount\":10,\"GroupByValue\":null,\"IDs\":{},\"Fields\":[],\"Scores\":[0.8595648,0.84206176,0.82866615,0.82839096,0.8255365,0.8249576,0.8247805,0.8240897,0.8239025,0.8229659],\"Err\":null},{\"ResultCount\":10,\"GroupByValue\":null,\"IDs\":{},\"Fields\":[],\"Scores\":[0.83529603,0.8336815,0.8268861,0.82295054,0.8185086,0.8182921,0.8170494,0.81612295,0.81608474,0.8134114],\"Err\":null},{\"ResultCount\":10,\"GroupByValue\":null,\"IDs\":{},\"Fields\":[],\"Scores\":[0.8150093,0.81420463,0.8127207,0.8117396,0.81072646,0.80872667,0.8062611,0.80541927,0.80410707,0.8020326],\"Err\":null},{\"ResultCount\":10,\"GroupByValue\":null,\"IDs\":{},\"Fields\":[],\"Scores\":[0.82852787,0.82767814,0.81999815,0.8182933,0.8177259,0.8169242,0.815581,0.8135153,0.81296486,0.8121435],\"Err\":null}]"] [2024/06/05 12:04:03.471 +08:00] [INFO] [testcases/search_test.go:38] [search] [ids={}] [2024/06/05 12:04:03.471 +08:00] [INFO] [testcases/search_test.go:39] [search] [scores="[0.81696415,0.8165557,0.8161729,0.81391853,0.8124938,0.80727804,0.8065588,0.8054077,0.80232,0.80066717]"] [2024/06/05 12:04:03.471 +08:00] [INFO] [testcases/search_test.go:41] [search] [ids=396] [2024/06/05 12:04:03.471 +08:00] [INFO] [base/milvus_client.go:37] [Request] [method=DropCollection] [reqs="{\"collection_name\":\"pre_KjXFUo\"}"]
No response
/assign @ThreadDao
fixed
Is there an existing issue for this?
Environment
Current Behavior
search outputfields * or vec field return []
case:
Expected Behavior
No response
Steps To Reproduce
No response
Milvus Log
No response
Anything else?
No response