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]: Enforcing limit on search doesn't work #775

Open
1 task done
mdmmn378 opened this issue Jun 19, 2024 · 2 comments
Open
1 task done

[Bug]: Enforcing limit on search doesn't work #775

mdmmn378 opened this issue Jun 19, 2024 · 2 comments

Comments

@mdmmn378
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I attempt to enforce a limit to vector search, it doesn't work and returns the full-length result.
image

Expected Behavior

When I enforce a limit explicitly, it should return the exact number of results, not more.

Steps To Reproduce

I used IVF_PQ INDEX_TYPE with the following configuration.

// Constants
const (
	N_PROBE    = 128
	N_LIST     = 4096
	N_BITS     = 8
	M          = 16
	VECTOR_DIM = 384
)

const (
	L2     MetricType = "L2"
	IP     MetricType = "IP"
	Cosine MetricType = "COSINE"
)

var ConsistencyLevel = entity.ClEventually

Here is the schema
```go

var COLLECTION_SCHEMA = entity.NewSchema().WithName(COLLECTION_NAME).WithDescription("this is the example collection for insert and search").
	WithField(entity.NewField().WithName("id").WithDataType(entity.FieldTypeVarChar).WithIsPrimaryKey(true).WithIsAutoID(false).WithMaxLength(128)).
	WithField(entity.NewField().WithName("vector").WithDataType(entity.FieldTypeFloatVector).WithDim(VECTOR_DIM)).
	WithField(entity.NewField().WithName("tag").WithDataType(entity.FieldTypeVarChar).WithMaxLength(128))


### Environment

_No response_

### Anything else?

_No response_
@mdmmn378 mdmmn378 changed the title [Bug]: Enforcing Limit on search doesn't work [Bug]: Enforcing limit on search doesn't work Jun 19, 2024
@ThreadDao
Copy link
Contributor

@congqixia Please help take a look.
@mdmmn378
image
It is recommended to use topk as the approximate number of vectors expected to be returned by the search.

@mdmmn378
Copy link
Author

Thanks for your comment.
I understand the role of topk. But, what's the exact role of limit here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants