Skip to content

feat: Support vector post-filtering and scoped FTS prefiltering - #91

Merged
yanghua merged 4 commits into
lance-format:mainfrom
zhangstar333:lance_prefilter_fts
Oct 8, 2026
Merged

yanghua merged 4 commits into
lance-format:mainfrom
zhangstar333:lance_prefilter_fts

Conversation

@zhangstar333

Copy link
Copy Markdown
Contributor
  • When vector search uses prefilter=false, defer applying the fragment filter until after nearest() is configured, allowing Lance to apply it as a post-filter.
  • For filtered FTS queries with prefiltering enabled, limit the prefilter scan to current fragments covered by the selected FTS index segments.
  • Preserve the existing behavior for unfiltered FTS scans.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 30, 2026

@yanghua yanghua left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two comments.

Comment thread src/scanner.rs
Comment thread src/scanner.rs
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 8, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Oct 8, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Oct 8, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

The strengthened FTS regression closes the earlier coverage gap. Its predicate matches both fragments and verifies selected IDs, unchanged global scores, and scoped prefilter work.

Fragments remain the search domain before Top-K; SQL postfilters apply after ranking within that domain. Filtered prepared FTS limits prefilter work to selected segments, while unfiltered and empty INDEX_ONLY scans retain their behavior.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 8, 2026

@yanghua yanghua left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yanghua
yanghua merged commit 8e9e09e into lance-format:main Oct 8, 2026
10 checks passed
yiguolei pushed a commit to apache/doris that referenced this pull request Oct 9, 2026
### What problem does this PR solve?
Problem Summary:
lance-format/lance-c#91

Include Lance-C vector post-filtering and scoped FTS prefiltering
improvements.


### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants