UnsupportedOperationException raised during "DFS query then fetch" with range query in rescorer


When I try to run a query with a range query rescorer, Elasticsearch
(version 1.3.2) will raise an java.lang.UnsupportedOperationException
on org.apache.lucene.search.Query.extractTerms. The exact class raising the
exception was NumericRangeQuery in my test.

After some investigations, I found that this occurs when ES try to extract
terms in each rescorer (source
Everything is working fine for the search query as it is rewritten before
the "extractTerms" method is called (source
If I rewrite myself the query as ES would do, everything seems to work
fine. This works because Lucene does not extract terms encapsulated in
filter inside ConstantScoreQuery (source

You can find the curl recreation is this gist
: https://gist.github.com/Jdourd/de2ab3f1eb23fe7e06be


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/86af99b8-84c4-4ef3-97fc-9eb2a3e996b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.