Skip to content

Conversation

mayya-sharipova
Copy link
Contributor

@mayya-sharipova mayya-sharipova commented Feb 3, 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 #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 specificatons are wrong. Closes elastic#121443
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Feb 3, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine
Copy link
Collaborator

Hi @mayya-sharipova, I've created a changelog YAML for you.

Copy link
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

*/
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");
Copy link
Contributor

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.

*/
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");
Copy link
Member

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.

@mayya-sharipova
Copy link
Contributor Author

mayya-sharipova commented Feb 5, 2025

@john-wagster @benwtrent Thank you for the feedback. I've modified the PR to use capabilties instead of a node feature.

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@benwtrent benwtrent added v9.0.0 auto-backport Automatically create backport pull requests when merged labels Feb 5, 2025
@mayya-sharipova mayya-sharipova added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Feb 5, 2025
@elasticsearchmachine elasticsearchmachine merged commit 5a56832 into elastic:main Feb 5, 2025
17 checks passed
@mayya-sharipova mayya-sharipova deleted the analyze-api-400 branch February 5, 2025 20:24
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
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0
8.x
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
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
elasticsearchmachine pushed a commit 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 #121443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Search Relevance/Analysis How text is split into tokens Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.19.0 v9.0.0 v9.1.0

4 participants