Repository navigation
feat(fts): add with_limit to PhraseQueryExec - #11659
Merged
hamersaw merged 1 commit intoDec 2, 2026
Merged
Conversation
Callers that over-fetch a bounded FTS leaf raise `FtsSearchParams::limit`, which lives in the exec rather than in a fetch node. `MatchQueryExec`, `FlatMatchQueryExec` and the compound execs already expose `with_limit` for this; `PhraseQueryExec` did not, so callers had to rebuild it through a constructor that drops its overlay block, external mask and shared scorer. Losing those widens the search domain or breaks the corpus-node binding. `with_limit` copies the node whole and changes only the limit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
westonpace
approved these changes
Dec 2, 2026
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.
Callers that over-fetch a bounded FTS leaf need to raise
FtsSearchParams::limit. The limit lives inside the exec, not in a fetch node, sowith_fetchcan't reach it. #10658 addedwith_limittoMatchQueryExecandFlatMatchQueryExec, and the compound execs already had one.PhraseQueryExecwas the remaining indexed leaf without it.Without
with_limit, a caller has to rebuild the node through a constructor. The constructors don't take the overlay block, the external mask or the shared corpus scorer, so a rebuild either drops rows lance excluded as superseded or breaks the bindingSharedFtsScorerExecchecks at execution.PhraseQueryExec::with_limitcopies the node whole and changes only the limit, followingMatchQueryExec::with_limit.Testing
test_phrase_query_exec_with_limit_keeps_domain: a phrase leaf scoped to one segment, widened from limit 1 to 20, still returns only that segment's rows even though every fragment matches. A leaf bound to a shared scorer keeps the same scorer by identity after widening.🤖 Generated with Claude Code