elasticsearch version 7.1.1
index mapping is:
{
"mappings": {
"properties": {
"@timestamp": { "type": "date" },
"value": { "type": "integer" }
}
}
}
index data is:
{"index":{"_index":"test","_id":"1"}}
{"@timestamp":"2020-08-26T13:00:00+08:00","value":1}
{"index":{"_index":"test","_id":"2"}}
{"@timestamp":"2020-08-26T14:00:00+08:00","value":2}
{"index":{"_index":"test","_id":"3"}}
{"@timestamp":"2020-08-26T15:00:00+08:00","value":3}
when i query with "now-60m"
{"query":{"range":{"@timestamp":{"gt":"now-60m"}}}}
got 1 hits
{"_index":"test","_type":"_doc","_id":"3","_score":1,"_source":{"@timestamp":"2020-08-26T15:00:00+08:00","value":3}}
when i query with "now-1h"
{"query":{"range":{"@timestamp":{"gt":"now-1h"}}}}
got 0 hits
even "now-1d" return 0 hits too
why?