We use ES 2.4.1.
When the date datatype field does not specify the 'format', we use the rounded date and specify the format in the query, the query result is incorrect.
mapping:
{
"rd": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
}
query:
{
"range" : {
"rd" : {
"from" : "2012-11-11||/M",
"to" : "2013-01-11||/M",
"format" : "yyyy-MM-dd",
"include_lower" : true,
"include_upper" : true
}
}
}
result:
{
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
When the 'format' is specified, the query result is correct.
{
"rd": {
"type": "date",
"format": "yyyyMMdd||strict_date_optional_time||epoch_millis"
},
}
Any help is appreciated!