-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
The include clause on the terms and significant_terms aggregations has a parse failure for string values provided for date and ip field types.
Steps to reproduce:
PUT test
{
"settings": {
"number_of_replicas": 0,
"number_of_shards":1
},
"mappings": {
"test": {
"properties": {
"stringField": {
"type": "string"
},
"dateTimeField": {
"type": "date",
"format": "date_time"
},
"ipField": {
"type": "ip"
}
}
}
}
}
POST test/test
{"stringField":"bar","ipField":"192.168.1.0", "dateTimeField":"2016-04-11T14:02:39.593Z"}
GET test/_search
{
"size":0,
"aggs": {
"this_works": {
"terms": {
"field": "stringField",
"include":["bar"]
}
}
}
}
GET test/_search
{
"size":0,
"aggs": {
"this_does_not_work": {
"terms": {
"field": "ipField",
"include":["192.168.1.0"]
}
}
}
}
GET test/_search
{
"size":0,
"aggs": {
"this_does_not_work": {
"terms": {
"field": "dateTimeField",
"include":["2016-04-11T14:02:39.593Z"]
}
}
}
}
The error returned is of the following type
{
"error": {
"root_cause": [
{
"type": "number_format_exception",
"reason": "For input string: \"2016-04-11T14:02:39.593Z\""
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query_fetch",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "test",
"node": "Qz_UtnGzTOeYEDLeOgTQLw",
"reason": {
"type": "number_format_exception",
"reason": "For input string: \"2016-04-11T14:02:39.593Z\""
}
}
]
},
"status": 400
}
jpountz