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

Warmers API breaking when empty Warmup query is created #4196

Closed
lmenezes opened this issue Nov 18, 2013 · 4 comments · Fixed by #4197
Closed

Warmers API breaking when empty Warmup query is created #4196

lmenezes opened this issue Nov 18, 2013 · 4 comments · Fixed by #4197

Comments

@lmenezes
Copy link
Contributor

Ran into this by accident, but basically if you add a warmup query with empty body, ES will accept it(even though I believe it shouldn't).
After accepting this empty bodied query, it's not possible anymore to access warmup queries by regular exp. that would also match this query. Follows how to reproduce(on 0.90.8-SNAPSHOT)

curl -XPOST http://localhost:9200/foo
curl -XPUT http://localhost:9200/foo/bar/1 -d '{"id":1,"content":"one"}'
curl -XPUT http://localhost:9200/foo/bar/2 -d '{"id":2,"content":"two"}'
curl -XPUT http://localhost:9200/foo/_warmer/warmer_1 -d '{"query": {"match_all":{}}}'
curl -XGET http://localhost:9200/foo/_warmer/w*
curl -XPUT http://localhost:9200/foo/_warmer/warmer_2
curl -XGET http://localhost:9200/foo/_warmer/w*

which yields:
{"error":"NullPointerException[null]","status":500}

@ghost ghost assigned spinscale Nov 18, 2013
@lmenezes
Copy link
Contributor Author

@spinscale i have some free time now. should i look into it or are you already doing it?

@spinscale
Copy link
Contributor

@lmenezes on it already... seems we should stop making the search request optional, when doing the validation.

thanks for your help, as usual :-)

@lmenezes
Copy link
Contributor Author

@spinscale np then. yep, i guess just rejecting empty requests would already solve the problem :)
thanks for the quick response!

spinscale added a commit that referenced this issue Nov 19, 2013
The search request inside of a put warmer request was nullable, but actually we have to have that request in the transport action.
Validation and appropriate test added.

Closes #4196
@lmenezes
Copy link
Contributor Author

👍

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
The search request inside of a put warmer request was nullable, but actually we have to have that request in the transport action.
Validation and appropriate test added.

Closes elastic#4196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants