feat: use --shard-key in search, query, and scroll requests#159
Merged
Conversation
The shard key was only applied to upserts and collection creation, so read requests always fanned out across all shards even when --shard-key was given. Apply the shard-key selector to search (flag- and config-driven), scroll/sample/random-point, and the UUID pre-fetch scroll whenever a shard key is provided. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
--shard-keywas only applied to upserts and collection creation, so read requests always fanned out across all shards even when a shard key was provided. This applies the shard-key selector to every applicable request so reads target the same shard the data was written to.Changes
src/search/from_args.rsQueryPointsBuilder)create_request_builder— flows into every batched query, including the exact-search quality passsrc/search/from_config.rscreate_request_buildersrc/scroll.rsscroll_cursor,sample,random_pointsrc/query.rsget_uuidspre-fetch scrollAll use the same idiom already established in
upsert.rs:Notes
QueryBatchPointsBuilderhas no top-level shard-key selector in qdrant-client 1.18 — the per-query selectors inside the batch are what route the request, which is where they're set.--shard-keyis not provided, behavior is unchanged (requests span all shards).cargo buildpasses. Not yet exercised end-to-end against a live sharded collection.🤖 Generated with Claude Code