Repository navigation
Conversation
_stopwords and _text_weights were consulted after TokenEscaper.escape, so the word the user typed never matched: it's was tested as it\'s against the English stopword set, and a text_weights key like don't never applied. Compare the raw normalized word, escape only after the filter and weight decisions, and keep the AGENTS.md normalization expression byte-identical. Signed-off-by: Christopher Krah <48338417+chrikrah@users.noreply.github.com>
This branch has not been deployed
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.
Motivation
Second bug of #821, as @vishal-bala invited there.
_tokenize_and_escape_querychecks_stopwordsand_text_weightsafter escaping. The word the user typed never matches:it'sis tested asit\'sagainst a set that containsit's, and adon'tweight key never applies.Changes
Membership runs on the raw normalized word. Escaping feeds only the clause. The normalization expression stays byte-identical. Three tests cover the stopword, the weight key, and the clause
AggregateHybridQuerysends.Notes
Only the shared helper changes, so
TextQuerykeeps its own tokenizer copy and gets this behavior once #831 moves it onto the helper. The two share no lines, so either can merge first.Release Notes
AggregateHybridQueryandHybridQuerynow match stopwords and text weights against the word the user typed, punctuation included. Contractions likeit'sdrop from scoring and weighted keys likedon'tapply, so results change for queries with such words.Reviewer Brief
Start at
_tokenize_and_escape_query: membership onword, escape output feeds only the clause. Falsification: with the fix reverted the three new tests fail; with it restored the touched suites are green.Fixes #821 (the second bug; #831 covers the first).