Below query is failing after I updated ElasticSearch to 1.6 from 1.4.4
GET index_name/_search
{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"term": {
"acknowledged": false
}
},
{
"term": {
"active": false
}
},
{
"exists": {
"field": "cleared_time"
}
}
],
"must_not": {
"term": {
"severity_number": 4
}
}
}
}
}
}
and below is the exception
org.elasticsearch.index.query.QueryParsingException: [index_name] Failed to parse
at org.elasticsearch.index.query.IndexQueryParserService.parseQuery(IndexQueryParserService.java:370)
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:187)
at org.elasticsearch.action.count.TransportCountAction.shardOperation(TransportCountAction.java:66)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.elasticsearch.index.query.ExistsFilterParser.newFilter(ExistsFilterParser.java:87)
at org.elasticsearch.index.query.ExistsFilterParser.parse(ExistsFilterParser.java:82)
at org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:368)
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:349)
at org.elasticsearch.index.query.BoolFilterParser.parse(BoolFilterParser.java:92)
at org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:368)
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:349)
at org.elasticsearch.index.query.FilteredQueryParser.parse(FilteredQueryParser.java:74)
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:302)
at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:382)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:281)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:276)
at org.elasticsearch.index.query.IndexQueryParserService.parseQuery(IndexQueryParserService.java:354)
There are 0 records in the index and same query works fine with ES 1.4.4.
If I remove
{
"exists": {
"field": "cleared_time"
}
}
from query in ES 1.6, it executes fine and returns the expected result.
Can i know what has changed from ES 1.4.4 to 1.6 and how to fix this exception?
Thanks.