Skip to content
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

ElasticsearchIllegalArgumentException when _only_nodes is used as a search preference #12389

Closed
ppf2 opened this issue Jul 22, 2015 · 6 comments
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v1.7.1

Comments

@ppf2
Copy link
Member

ppf2 commented Jul 22, 2015

I can reproduce this using REST and Java API + ES 1.7.0

The following works:

GET /_search?explain&preference=_only_node:6qdURxYySpCWugwxuvIH3g

The following throws the error:

GET /_search?explain&preference=_only_nodes:pod:A

{"error":"ElasticsearchIllegalArgumentException[no Preference for [_only_nodes]]","status":400}

I am able to workaround this by using the ENUM value from org.elasticsearch.cluster.routing.operation.plain.Preference directly:

The following works:
GET /_search?explain&preference=ONLY_NODES:pod:A

_only_nodes should work just like _only_node (and not require using the ONLY_NODES enum)?

@nirmalc
Copy link
Contributor

nirmalc commented Jul 22, 2015

its broken in 1.7 as "_only_nodes" is not parsed to right preference. (
Preference.java - parse )

Thanks
Nirmal

On Tue, Jul 21, 2015 at 7:08 PM, Pius notifications@github.com wrote:

I can reproduce this using REST and Java API + ES 1.7.0

The following works:

GET /_search?explain&preference=_only_node:6qdURxYySpCWugwxuvIH3g

The following throws the error:

GET /_search?explain&preference=_only_nodes:pod:A

{"error":"ElasticsearchIllegalArgumentException[no Preference for [_only_nodes]]","status":400}

I am able to workaround this by using the ENUM value from
org.elasticsearch.cluster.routing.operation.plain.Preference directly:

The following works:
GET /_search?explain&preference=ONLY_NODES:pod:A

_only_nodes should work just like _only_node?


Reply to this email directly or view it on GitHub
#12389.

@clintongormley clintongormley added >bug :Search/Search Search-related issues that do not fall into other categories v1.7.1 labels Jul 23, 2015
@clintongormley
Copy link

@nirmalc want to send a fix?

@nirmalc
Copy link
Contributor

nirmalc commented Jul 23, 2015

@clintongormley , will look at it today and send fix. I think its minor merge issue with 1.7 tree

@nirmalc
Copy link
Contributor

nirmalc commented Jul 25, 2015

@ppf2 - using enum directly doesnt actually work ; its considering preference as custom string value probably. we consider it as custom preference if preference value begins with "_"

@ppf2
Copy link
Member Author

ppf2 commented Jul 27, 2015

@nirmalc yah you are right, was testing with just 2 nodes, so it appeared that it worked with ONLY_NODES when switching the node attributes but in fact it was just treating them as custom routing values. Thx for submitting the fix 👍

spinscale pushed a commit that referenced this issue Jul 28, 2015
The `_only_nodes` preference was not parsed correctly.
This adds the preference, so it gets parsed as lowercase as
well as tests.

Closes #12460
Closes #12389
@spinscale
Copy link
Contributor

Closed by 2fa7404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v1.7.1
Projects
None yet
Development

No branches or pull requests

4 participants