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

NullPointerException on facet_filter when no actual filter is added #3724

Closed
lmenezes opened this Issue Sep 18, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@lmenezes
Contributor

lmenezes commented Sep 18, 2013

to reproduce(0.90.5):

curl -XPOST http://localhost:9200/foo
curl -XPUT http://localhost:9200/foo/bar/1 -d '{"id":1,"content":1}'
curl -XPUT http://localhost:9200/foo/bar/2 -d '{"id":2,"content":2}'
curl -XPOST http://localhost:9200/foo/bar/_search -d '{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{"and":{"filters":[]}}}}}'
curl -XPOST http://localhost:9200/foo/bar/_search -d '{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ }}}}'
curl -XPOST http://localhost:9200/foo/bar/_search -d '{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{"and":{"filters":[{ "term" : { "id" : 1 } }]}}}}}'
curl -XPOST http://localhost:9200/foo/bar/_search -d '{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ "term" : { "id" : 1 } }}}}'

first two searches fail with:
{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[l8GT-BrMQYqwmTWkppI5tw][foo][3]: SearchParseException[[foo][3]: query[ConstantScore(:)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ }}}}]]]; nested: NullPointerException; }{[l8GT-BrMQYqwmTWkppI5tw][foo][2]: SearchParseException[[foo][2]: query[ConstantScore(:)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ }}}}]]]; nested: NullPointerException; }{[l8GT-BrMQYqwmTWkppI5tw][foo][4]: SearchParseException[[foo][4]: query[ConstantScore(:)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ }}}}]]]; nested: NullPointerException; }{[l8GT-BrMQYqwmTWkppI5tw][foo][1]: SearchParseException[[foo][1]: query[ConstantScore(:)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ }}}}]]]; nested: NullPointerException; }{[l8GT-BrMQYqwmTWkppI5tw][foo][0]: SearchParseException[[foo][0]: query[ConstantScore(:)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match_all":{}},"facets":{"content":{"terms":{"field":"content"},"facet_filter":{ }}}}]]]; nested: NullPointerException; }]","status":400}

@lmenezes

This comment has been minimized.

Contributor

lmenezes commented Sep 18, 2013

(this used to work on 0.90.0)

@ghost ghost assigned javanna Sep 18, 2013

@javanna

This comment has been minimized.

Member

javanna commented Sep 18, 2013

Thanks for reporting this! As I noticed this is not the first time you report a NPE using an empty filter, I'm making sure this won't happen again (famous last words!). A commit will follow shortly.

@javanna javanna closed this in cf0c360 Sep 18, 2013

javanna added a commit that referenced this issue Sep 18, 2013

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment