Elasticsearch version: 2.4.5
JVM version (java -version
): 1.8.0_111
Description of the problem including expected versus actual behavior:
Using a range query inside an or
inside a not
causes an error on 2.4.5, but not on 1.7.1.
Steps to reproduce:
This query works fine:
{
"filter": {
"or": [
{ "range": { "value": { "gte": 1, "lt": 3 } } },
{ "range": { "value": { "gte": 5, "lt": 7 } } }
]
}
}
but wrapping the or
in a not
will cause an error:
{
"filter": {
"not": {
"or": [
{ "range": { "value": { "gte": 1, "lt": 3 } } },
{ "range": { "value": { "gte": 5, "lt": 7 } } }
]
}
}
}
where the error is a query_parsing_exception
with message [or] query does not support [gte]
.
That doesn't seem accurate because it works fine without the not
.
We are trying to upgrade to 2.x and getting this error there. Our existing version is 1.7.1 where there is no error. (The error occurs on both 2.4.5 and 2.0.0.)
We realize or
is deprecated, but converting our code to use should
/must
syntax is a huge amount of work for various reasons, so we'd prefer any other workarounds or suggestions. Thanks!