RangeQuery on date field cannot be nested inside SpanMultiTermQuery#12123
RangeQuery on date field cannot be nested inside SpanMultiTermQuery#12123cbuescher wants to merge 2 commits intoelastic:masterfrom
Conversation
|
The only reason Rather what I'm leaning towards to, is to just forbid the usage of |
|
Thanks, I have the feeling that the |
I have the same feeling :(
It adds complexity and the LateQueryParsing workaround is leaking to other places in the code base, but if we 're okay with catching this special case, then I think we can go for it. We should just put a big comment on top of that if statement. This if statement should make the test pass: if (subQuery instanceof DateFieldMapper.DateFieldType.LateParsingQuery) {
subQuery = ((DateFieldMapper.DateFieldType.LateParsingQuery) subQuery).rewrite(null);
}(Also LateParsingQuery needs to be made public) |
|
Okay, such SpanMultiTermQuery (with nestes date RangeQuery) would not work with |
|
Tried to make test pass with the suggested workaround, but now test complains with |
|
I agree @cbuescher probably disallowing it is the best way forward at least for now |
|
On the query refactoring branch we now decided to reject SpanMultiTermQueries that wrap inner queries that don't produce MultiTerm lucene queries like the date field RangeQuery, so I'm closing this PR. |
This PR explains the issue in #12122 by adding an integration test to SearchQueryTests. The additional query setup triggers the following internal parsing exception.
This PR only adds the test code for #12122 since I have no idea for a fix yet. Mainly to illustrate the problem and discuss solutions.