Open
Conversation
The native engine enforces a hard topk ceiling of 1024 on
collection.query(). This adds a `max_query_topk` parameter to
zvec.init() so users can raise the limit when they accept the
extra memory/latency tradeoff.
Changes:
- Add `max_query_topk` to GlobalConfig::ConfigData with default 1024
- VectorQuery::validate() reads the limit from GlobalConfig instead
of the hardcoded kMaxQueryTopk constant
- Expose the parameter in Python zvec.init() with type/range validation
- Parse and validate in the pybind11 config bridge
- Add C API getter/setter: zvec_config_data_{set,get}_max_query_topk()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
max_query_topkparameter tozvec.init()so users can raise the hard topk ceiling (default 1024) when they accept the extra memory/latency tradeoffGlobalConfigand reads it inVectorQuery::validate()instead of using the hardcodedkMaxQueryTopkconstantzvec_config_data_{set,get}_max_query_topk()Usage
Files changed (7)
src/include/zvec/db/config.hmax_query_topktoConfigData+ accessorsrc/db/common/config.ccsrc/db/index/common/doc.ccVectorQuery::validate()python/zvec/zvec.pymax_query_topkparam with type/range validationsrc/binding/python/model/common/python_config.ccsrc/include/zvec/c_api.hsrc/binding/c/c_api.ccTest plan
🤖 Generated with Claude Code