Min date and max date

how can i get min date and max date in elastic search

USing a min aggregation and a max aggregation I guess.

i got solution for this

GET /cc_demo1/_search?size=0
{
    "aggs" : {
       "min_date": {"min": {"field": "date", "format": "yyyy-MM-dd"}},
       "max_date": {"max": {"field": "date", "format": "yyyy-MM-dd"}}
    }
}
3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.