fix(core): fill a filtered vector window instead of stopping at rejected neighbours - #1575
Merged
Merged
Conversation
…ted neighbours The vector index ranks by similarity alone and cannot evaluate structured filters (note types, dates, categories, metadata, path prefixes, valid time). Vector and hybrid retrieval took one window of `candidate_limit` chunks from that ranking and asked the full-text pass which of them the filters admitted. When the nearest chunks belonged to rows the filter rejects, the window held few admitted rows while more sat just past it, and the page came back short although matches existed. `vector_only` now resolves its window through `_candidate_window`, which re-reads the ranking with a bounded geometric overfetch until the window holds `candidate_limit` admitted rows, the ranking is exhausted (a short read, no growth, or the scan cap), or its tail has fallen below the similarity threshold, past which nothing further can qualify. A query without filters resolves its window once, as before. The chunk-to-row resolution (keys, threshold, row fetch, filter) moves into `_resolve_rows`, returning a frozen `CandidateWindow`; `_run_vector_query` and the trace stage are unchanged, and each round replaces the previous round's rejection lists so the trace reads the final window. Refs #1558 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV Signed-off-by: phernandez <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Same branch and commit as #1570, opened against
mainnow that #1574 has landed. GitHub refuses to retarget a PR that is part of a stack. See #1570 for the full description and test plan.A vector or hybrid search that carries structured filters now fills its candidate window: the reader re-reads the ranking with a bounded geometric overfetch until the window holds enough admitted rows, the ranking is exhausted, or its tail falls below the similarity threshold. Unfiltered searches read their window once, as before.
Refs #1558, #1570
🤖 Generated with Claude Code
https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV