-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analyze API to return 400 for wrong custom analyzer #121568
Analyze API to return 400 for wrong custom analyzer #121568
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
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Hi @mayya-sharipova, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -65,6 +66,8 @@ | |||
*/ | |||
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -65,6 +66,8 @@ | |||
*/ | |||
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@john-wagster @benwtrent Thank you for the feedback. I've modified the PR to use capabilties instead of a node feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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
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