I have the following mapping :
{
"my_index": {
"mappings": {
"my_type": {
"properties": {
"date": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis||dd/MM/yyyy HH:mm"
}
"data": {
"type": "keyword"
}
}
}
}
}
}
And I post the following query :
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
]
}
},
"aggs": {
"filter": {
"range": {
"date": {
"gte": 1476108600401,
"lte": 1507644600401,
"format": "epoch_millis"
}
}
},
"aggs": {
"value": {
"terms": {
"field": "value",
"size": 10
}
}
}
}
}
And I get the following error;
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[range] unknown field [date], parser not found"
}
],
"type": "illegal_argument_exception",
"reason": "[range] unknown field [date], parser not found"
},
"status": 400
}
Note that when removing the range query and move it to the query part, everything works fine :
{
"query": {
"bool": {
"must": [
{
"match_all": {}
},
{
"range": {
"date": {
"gte": 1476108600401,
"lte": 1507644600401,
"format": "epoch_millis"
}
}
}
]
}
}
}
Is there something I missed ?
I'm using elasticsearch 5.5.0
Pierre.