Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [GOSDK] Expected to return nq ResultSet when searching from an empty collection #33952

Closed
1 task done
ThreadDao opened this issue Jun 18, 2024 · 3 comments
Closed
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@ThreadDao
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20240617-e83ecd50-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:

Current Behavior

Search func returns []ResultSet. When search from empty collection with 5(nq) vectors, the result is [], an empty slice.
Expected to return nq(5) ResultSet, though each ResultSet has 0 ResultCount, empty IDs, empty Scores, empty Fields, an Err search result is empty

type ResultSet struct {
	ResultCount  int // the returning entry count
	GroupByValue column.Column
	IDs          column.Column // auto generated id, can be mapped to the columns from `Insert` API
	Fields       DataSet       // output field data
	Scores       []float32     // distance to the target vector
	Err          error         // search error if any
}

Expected Behavior

No response

Steps To Reproduce

func TestSearchEmptySparseCollection(t *testing.T) {
	ctx := hp.CreateContext(t, time.Second*common.DefaultTimeout)
	mc := createDefaultMilvusClient(ctx, t)

	_, schema := hp.CollPrepare.CreateCollection(ctx, t, mc, hp.NewCreateCollectionParams(hp.Int64VarcharSparseVec), hp.TNewFieldsOption(),
		hp.TNewSchemaOption().TWithEnableDynamicField(true))
	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.FieldTypeSparseVector)
	resSearch, errSearch := mc.Search(ctx, clientv2.NewSearchOption(schema.CollectionName, common.DefaultLimit, vectors).
		WithConsistencyLevel(entity.ClStrong).WithANNSField(common.DefaultSparseVecFieldName))
	common.CheckErr(t, errSearch, true)
	// common.CheckSearchResult(t, resSearch, 0, 0)
}


### Milvus Log

_No response_

### Anything else?

_No response_
@ThreadDao ThreadDao added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 18, 2024
@ThreadDao ThreadDao added this to the 2.5.0 milestone Jun 18, 2024
@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 19, 2024
@yanliang567 yanliang567 removed their assignment Jun 19, 2024
congqixia added a commit to congqixia/milvus that referenced this issue Jun 25, 2024
See also milvus-io#33952

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
sre-ci-robot pushed a commit that referenced this issue Jun 25, 2024
See also #33952

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
@congqixia
Copy link
Contributor

/assign @ThreadDao

@ThreadDao
Copy link
Contributor Author

fixed

sre-ci-robot pushed a commit that referenced this issue Jun 27, 2024
issue: #33952 #33627 #33419

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
yellow-shine pushed a commit to yellow-shine/milvus that referenced this issue Jul 2, 2024
yellow-shine pushed a commit to yellow-shine/milvus that referenced this issue Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants