fix(session-search): route short CJK OR queries to LIKE - #20499
Closed
LeonSGP43 wants to merge 1 commit into
Closed
Conversation
Contributor
|
This looks implemented on current main, so this PR can be closed as already fixed. This is an automated hermes-sweeper review. Evidence:
|
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
Fixes #20494.
search_messages()already avoids trigram FTS for single 1-2 character CJK queries because SQLite trigram cannot match them. Boolean queries like广西 OR 桂林 OR 漓江 OR 旅游slipped through because the code checked the total CJK character count across the whole query, selected trigram, and returned no hits.This PR:
Verification
scripts/run_tests.sh tests/test_hermes_state.py -k 'CJK or cjk'-> 19 passed, 4 warningsscripts/run_tests.sh tests/test_hermes_state.py-> 212 passed, 4 warningsgit diff --checkOverlap Check
I checked open PRs for
20494,session_search,CJK, andtrigram. The active nearby PRs are broader session-search/schema work (#20238, #20239), but I did not find a direct fix for this short-token boolean CJK routing bug. This patch is limited tohermes_state.pysearch routing and targeted regression tests.