feat(fts): show tokenized queries in analyze plan - #8414
Open
BubbleCal wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The change captures analyzer output at the execution boundary where tokenizer selection is authoritative, preserves it through plan replacement, and leaves non-executing explain plans unchanged. This is preferable to eager planning-time tokenization, which could observe the wrong tokenizer and blur the explain/analyze contract.
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.
What is the new feature?
analyze_plannow shows both the original FTS query and its execution-time tokenized representation, including token text and normalized positions.Why do we need this feature?
Users need to see how the configured tokenizer transforms a query when debugging lowercasing, stemming, stop-word removal, phrase positions, and other analyzer behavior.
How does it work?
tokenized_queryto indexed and flat Match/Phrase nodes and posting-backed compound query leaves.explain_planunchanged because it does not execute the tokenizer.Validation
cargo test -p lance test_analyze_plan_shows --lib: 3 passeduv run make lintfrompython/: passedcargo fmt --all -- --check: passedcargo clippy --all --tests --benches -- -D warnings: passedgit diff main...HEAD --check: passedLimitations
Plans that resolve directly to
EmptyExecdo not execute an FTS tokenizer node, so they have no tokenization snapshot to display.Linear: OSS-2007