Hi All,
I need a date range query for which input will be only year, but in the response, it should contain all the documents within that year like.
Find the below example,
"startDate": {
"type": "date",
"format": "yyyy-MM-dd||yyyy-MM||yyyy"
}
While indexing data into ES, this field may contain different values like below,
- 2017
- 2017-09
- 2017-08-23
So, with the below query, when i am searching i am getting only one document as response.
{
"query":{
"range":{
"standardisedFinancials.identification.startDate":{
"gte":"2014",
"lte":"2014"
}
}
}
}
Could someone please help me on writing the query which gets all the documents containing 2014 as well as 2014-09-20.
Thanks,
Ram Prasad G