NullPointerException after updating Elasticsearch to 1.6


(Nemo) #1

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.


(David Pilato) #2

Does the mapping exist for this field?


(Nemo) #3

Yes, I can see mapping for all four fields. Below is the mapping

{
"index_name": {
"aliases": {},
"mappings": {
"default": {
"_timestamp": {
"enabled": true,
"store": true
},
"properties": {
"acknowledged": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"cleared_time": {
"type": "date",
"format": "dateOptionalTime"
},
"severity_number": {
"type": "long"
}
}
}
},
"settings": {
"index": {
"creation_date": "1436217586038",
"number_of_shards": "5",
"number_of_replicas": "1",
"version": {
"created": "1060099"
},
"uuid": "1HHZ-xxx"
}
},
"warmers": {}
}
}


(David Pilato) #4

I would probably open an issue with a script which reproduces it.


(system) #5