I have created an index using below mapping.
Index Mapping:
{
"mappings": {
"document": {
"properties": {
"doc_date": {
"type": "date" ,
"format": "yyyy/MM/dd"
}
}
}
}
}
I indexed two records. Like below.
Records:
{
"doc_date": "2017/06/10",
"Record":"A"
}
{
"doc_date": "2017/05/10",
"Record":"D"
}
I wanted to select documents which are greater than or equal to date 2017/06/10.
Query:
{
"query": {
"range" : {
"doc_date" : {
"lte": "2017/06/10",
"format": "yyyy/MM/dd"
}
}
}
}
But the above query returned all the document in the index.
ElasticSearch version:5.0.2
gte
, notlte
– Praneeth