Analyze API to return 400 for wrong custom analyzer#121568
Merged
elasticsearchmachine merged 7 commits intoelastic:mainfrom Feb 5, 2025
Merged
Analyze API to return 400 for wrong custom analyzer#121568elasticsearchmachine merged 7 commits intoelastic:mainfrom
elasticsearchmachine merged 7 commits intoelastic:mainfrom
Conversation
If a custom analyzer provided in _analyze API can not be built, return 400 instead of the current 500. This most probably means that the user's provided analyzer specificatons are wrong. Closes elastic#121443
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Collaborator
|
Hi @mayya-sharipova, I've created a changelog YAML for you. |
john-wagster
reviewed
Feb 3, 2025
| */ | ||
| public class TransportAnalyzeAction extends TransportSingleShardAction<AnalyzeAction.Request, AnalyzeAction.Response> { | ||
|
|
||
| public static final NodeFeature WRONG_CUSTOM_ANALYZER_RETURN_400 = new NodeFeature("wrong_custom_analyzer_return_400"); |
Contributor
There was a problem hiding this comment.
more for curiosity does this need to be a nodefeature or can it be a test feature. it's unfortunate stuff like this has to be enumerated.
benwtrent
reviewed
Feb 3, 2025
| */ | ||
| public class TransportAnalyzeAction extends TransportSingleShardAction<AnalyzeAction.Request, AnalyzeAction.Response> { | ||
|
|
||
| public static final NodeFeature WRONG_CUSTOM_ANALYZER_RETURN_400 = new NodeFeature("wrong_custom_analyzer_return_400"); |
Member
There was a problem hiding this comment.
Could you simply make this a capability on the REST API side? That is much simpler and then you don't need all these feature things.
Contributor
Author
|
@john-wagster @benwtrent Thank you for the feedback. I've modified the PR to use capabilties instead of a node feature. |
john-wagster
approved these changes
Feb 5, 2025
mayya-sharipova
added a commit
to mayya-sharipova/elasticsearch
that referenced
this pull request
Feb 5, 2025
If a custom analyzer provided in _analyze API can not be built, return 400 instead of the current 500. This most probably means that the user's provided analyzer specifications are wrong. Closes elastic#121443
Collaborator
mayya-sharipova
added a commit
to mayya-sharipova/elasticsearch
that referenced
this pull request
Feb 5, 2025
If a custom analyzer provided in _analyze API can not be built, return 400 instead of the current 500. This most probably means that the user's provided analyzer specifications are wrong. Closes elastic#121443
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 5, 2025
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 5, 2025
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.
If a custom analyzer provided in _analyze API
can not be built, return 400 instead of the current
500. This most probably means that the user's provided analyzer specifications are wrong.
Closes #121443