Skip to content

fix(fts): use substring-safe ngram defaults - #8779

Merged
Xuanwo merged 3 commits into
mainfrom
gatekeeper/fix-8777-1
Sep 2, 2026
Merged

fix(fts): use substring-safe ngram defaults#8779
Xuanwo merged 3 commits into
mainfrom
gatekeeper/fix-8777-1

Conversation

@lance-gatefixer

Copy link
Copy Markdown
Contributor

Summary

  • make the NGRAM tokenizer disable stemming and stop-word removal by default so valid substring tokens are not discarded
  • preserve explicit filter overrides and analyzer settings persisted by existing indexes
  • document the conditional defaults and extend the existing multi-fragment Python FTS regression test

Root cause

Selecting base_tokenizer="ngram" changed the lexical tokenizer but inherited the text analyzer defaults, which enable word-oriented stemming and stop-word removal. Both indexed content and queries therefore dropped valid NGRAM tokens such as the.

Existing NGRAM indexes retain their persisted analyzer behavior and must be rebuilt to adopt the corrected defaults.

Validation

  • cargo test -p lance-index scalar::inverted::tokenizer::tests
  • uv run make build
  • uv run pytest python/tests/test_scalar_index.py::test_fts_ngram_tokenizer -q
  • uv run make lint
  • cargo fmt --all
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #8777

@github-actions github-actions Bot added A-python Python bindings A-index Vector index, linalg, tokenizer bug Something isn't working labels Aug 26, 2026
@lance-gatefixer

Copy link
Copy Markdown
Contributor Author

Blocked: the current-head Python macOS 3.14 ARM check failed in a MemWAL test outside the FTS repair, with no evidence supporting an attributable code change.

Remote head 2609852 contains current main tip 7b80136. Python macOS 3.14 ARM (run 32948474973, job 98114307860) failed only python/tests/test_mem_wal.py::test_shard_writer_lsm_scanner_includes_own_sstables because _pk_index/page_lookup.lance was not found; the job otherwise reported 1,346 passing tests, while the repair diff is limited to FTS tokenizer defaults, documentation, and regression coverage.

I fetched and verified both refs, inspected the complete failure evidence, and reran the exact failed test on this head, where it passed. Please rerun the failed check; alternatively, investigate the independent MemWAL missing-file failure if it reproduces.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 26, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 2, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The merge from main preserves the previously verified NGRAM behavior: omitted word filters remain substring-safe, while explicit and persisted settings stay authoritative.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 2, 2026
@Xuanwo
Xuanwo merged commit fdeb955 into main Sep 2, 2026
38 checks passed
@Xuanwo
Xuanwo deleted the gatekeeper/fix-8777-1 branch September 2, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer A-python Python bindings bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FTS NGRAM defaults remove valid substring queries via stop-word filtering

1 participant