Date filtering from crash course part 2

In part 2 of the crash course Part-2-Understanding-the-relevance-of-your-search-with-Elasticsearch-and-Kibana-/README.md at main · LisaHJung/Part-2-Understanding-the-relevance-of-your-search-with-Elasticsearch-and-Kibana- · GitHub I see this date filter used:

GET news_headlines/_search
{
  "query": {
    "range": {
      "date": {
        "gte": "2015-06-20",
        "lte": "2015-09-22"
      }
    }
  }
}

Does Elasticsearch interpret these as dates? Or is it just a string, and the date filtering is truly a string filter? Or put another way, if the date field in these documents were formatted in a less-friendly way, like 4/7/2021 and 10/13/2021, would these be correctly filterable?

Yes it'll translate that into a time format that Elasticsearch can then query against the data.

Take a look at format | Elasticsearch Guide [7.15] | Elastic for what formats are supported.

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