[fix](search) Validate mode parameter in search() DSL options#60785
Open
airborne12 wants to merge 1 commit intoapache:masterfrom
Open
[fix](search) Validate mode parameter in search() DSL options#60785airborne12 wants to merge 1 commit intoapache:masterfrom
airborne12 wants to merge 1 commit intoapache:masterfrom
Conversation
Invalid mode values (e.g. "lucenedfafa") were silently accepted and fell back to standard mode. Now rejects invalid modes with a clear error message listing the valid values: "standard" and "lucene".
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
TPC-H: Total hot run time: 28691 ms |
TPC-DS: Total hot run time: 183967 ms |
Contributor
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
Contributor
FE Regression Coverage ReportIncrement line coverage |
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 #DORIS-24352
Problem Summary:
When using
search()with an invalidmodevalue in the options JSON (e.g.,"mode":"lucenedfafa"), the query silently falls back to standard mode instead of reporting an error. This makes it difficult for users to detect typos or misconfiguration.This PR adds validation in
SearchOptions.validate()to reject any mode value other than"standard"or"lucene", throwing a clear error message.Release note
Fix search() DSL to report an error when an invalid mode value is specified instead of silently falling back to standard mode.
Check List (For Author)
Test
Behavior changed:
IllegalArgumentExceptionwith a descriptive message.Does this need documentation?
Check List (For Reviewer who merge this PR)