fix: build list FTS indexes as row documents#7656
Merged
Merged
Conversation
Xuanwo
marked this pull request as ready for review
July 7, 2026 08:09
BubbleCal
reviewed
Jul 7, 2026
| posting_memory_delta += | ||
| new_posting_memory_size as i64 - old_posting_memory_size as i64; | ||
| token_num += 1; | ||
| last_position = Some(position); |
Contributor
There was a problem hiding this comment.
["want the", "apple"] would be treated as "want apple" with positions [0, 1]
but "want the apple" would be "want apple" with positions [0, 2] (the stop words also contribute to the position increment)
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jul 7, 2026
BubbleCal
approved these changes
Jul 7, 2026
BubbleCal
pushed a commit
that referenced
this pull request
Jul 7, 2026
…igurable Resolves the process_document conflict against the list-FTS restructure (#7656): keep main's DocumentSource/process_text closure shape and thread this branch's posting block_size through the PostingListBuilder construction sites (position closure and the positionless resize_with).
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
Close #5887
Build FTS indexes for list string columns as row-level documents instead of flattening each list element into its own document.
This means
List<Utf8>,List<LargeUtf8>, and theirLargeListvariants now treat a row as one document, with non-null list elements contributing text fragments to that document. Token positions are continuous across list elements, so phrase queries can match across element boundaries.The change intentionally does not add user parameters, persistent metadata, legacy migration, or query-side deduplication. Old list indexes keep their existing behavior.
Context
Issue #5887 reports duplicate FTS results for list string columns because the old index builder treated each list element as a separate document with the same row id. Row-level indexing fixes the result duplication and brings BM25 document statistics back to row-level semantics for newly built indexes.
Follow-up issue #7654 tracks MemWAL in-memory FTS support for list string columns.
Validation
cargo fmt --allgit diff --checkcargo test -p lance-index flat_bm25_searchcargo test -p lance-index test_worker_cargo test -p lance test_fts_listcargo test -p lance test_fts_index_with_cargo clippy -p lance-index --tests -- -D warningscargo clippy -p lance --tests -- -D warnings