[python] Verify candidate-only scalar filters before vector top-k - #9999
Merged
JingsongLi merged 2 commits intoSep 20, 2026
Merged
Conversation
JingsongLi
reviewed
Sep 20, 2026
Contributor
|
+1 |
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.
Purpose
Prevent candidate-only scalar index answers from admitting non-matching rows into vector top-k. For example, with a BTree name index and an IVF vector index,
name LIKE '%zeta%'can currently return the neareralpharow instead ofbeta zeta. Filtering after top-k cannot recover the displaced match.Carry scalar-result exactness through offsets, unions, intersections, coverage padding and conjunctions that drop an unsupported child. BTree prefix/substring answers are candidates; exact BTree equality/range results and exact bitmap string matches retain their existing path without a data recheck. When multiple indexes answer the same predicate, an exact reader makes their intersection exact; conjunctions of different predicates still require every child to be exact. This preserves exact BTree-plus-bitmap matches without a data recheck. Tracking the result also handles partially evaluable conditions on the same field, where contributing field IDs alone are insufficient.
Use the
global-index.filter.refine-from-datatable option introduced by #9953, with the same default offalse. Inexact index candidates are excluded with a warning by default. When enabled, read the candidate filter columns at the pinned snapshot to build an exact include bitmap before ANN top-k. This read is streamed, applies deletion handling, and does not project candidate vectors. Completely unsupported scalar evaluations can also use this opt-in verification. Local/Ray and single/batch vector execution share this path.Related to #9883. This change covers Python data-evolution vector search; full-text filtering remains unchanged.
Tests
git diff --checkpassed for changed files. Native index tests used paimon-vindex 0.4.0.