How do I return entries from 24 hours ago in elastic search?

1.5k Views Asked by At
GET /document/product/_search
{
  "query": {
    "match": {
      "filename": "Trident"
    }
},
  "range" : {
    "timestamp" : {
        "gt" : "now-24h"
    }
  }
}

So, I'm trying to return all data entry from the past 24 hours.

In the docs, the date format is "2014-01-07 00:00:00"

but my timestamp format is "2017-05-31T13:52:41.740Z"

I think because my date format is different from the docs, My query doesn't work. How would I be able to get past 24 hour entry with this date format?

0

There are 0 best solutions below