Skip to content

branch-4.1: [fix](search) Fix slash character in search query_string terms #61599 - #61619

Merged
airborne12 merged 1 commit into
branch-4.1from
auto-pick-61599-branch-4.1
Mar 24, 2026
Merged

branch-4.1: [fix](search) Fix slash character in search query_string terms #61599#61619
airborne12 merged 1 commit into
branch-4.1from
auto-pick-61599-branch-4.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #61599

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
The ANTLR lexer in the search() DSL parser excluded `/` from
`TERM_CHAR`, causing terms like `AC/DC` to be incorrectly tokenized. The
slash was silently skipped by ANTLR's default error recovery, splitting
`AC/DC` into two separate terms `AC` and `DC` instead 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 the `TERM_CHAR` fragment in `SearchLexer.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 from `TERM_START_CHAR`.
@yiguolei
yiguoleiforce-pushed the auto-pick-61599-branch-4.1 branch from 6085f93 to 12810efCompareMarch 24, 2026 01:22
@yiguolei

Copy link
Copy Markdown
Contributor

run buildall

@yiguolei

Copy link
Copy Markdown
Contributor

skip buildall

@airborne12
airborne12 merged commit 3090a30 into branch-4.1Mar 24, 2026
28 of 31 checks passed
@airborne12
airborne12 deleted the auto-pick-61599-branch-4.1 branch March 24, 2026 07:21
@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Mar 24, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by anyone and no changes requested.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hello-stephen@yiguolei@airborne12@dataroaring