[fix](search) Fix slash character in search query_string terms#61599
Open
airborne12 wants to merge 1 commit intoapache:masterfrom
Open
[fix](search) Fix slash character in search query_string terms#61599airborne12 wants to merge 1 commit intoapache:masterfrom
airborne12 wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
The ANTLR lexer excluded '/' from TERM_CHAR, causing terms like 'AC/DC' to be incorrectly tokenized — the slash was silently skipped, splitting it into two separate terms. Add '/' to TERM_CHAR so it can appear within terms while regex patterns (/pattern/) still work since '/' remains excluded from TERM_START_CHAR.
1e7f9c4 to
67a7155
Compare
Member
Author
|
run buildall |
TPC-H: Total hot run time: 26636 ms |
TPC-DS: Total hot run time: 168909 ms |
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 problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
The ANTLR lexer in the search() DSL parser excluded
/fromTERM_CHAR, causing terms likeAC/DCto be incorrectly tokenized. The slash was silently skipped by ANTLR's default error recovery, splittingAC/DCinto two separate termsACandDCinstead of treating it as a single term.This caused inconsistent behavior compared to Elasticsearch's query_string parsing, where
AC\/DC(escaped slash) is handled as a single analyzed term.Fix: Add
/to theTERM_CHARfragment inSearchLexer.g4. This allows/to appear within terms (e.g.,AC/DC-> single term) while regex patterns like/[a-z]+/still work correctly since/remains excluded fromTERM_START_CHAR.Release note
Fix search() function incorrectly handling slash (/) character within query terms (e.g.,
AC/DC). The slash is now treated as a regular character within terms instead of being silently dropped.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)