Hello there,
I'm trying to do a request which is depending on a date field
"@timestamp": { "type": "date" }
The query looks like this:
{
"aggs": {
"2": {
"date_histogram": {
"field": "@timestamp",
"interval": "3600000ms",
"time_zone": "Europe/Berlin",
"min_doc_count": 1
},
"aggs": {
"by_channel": {
"terms": {
"field": "cid"
}
}
}
}
},
"size": 0,
"query": {
"bool": {
"must": [
{
"match_phrase": {
"tenant": {
"query": "My tenant"
}
}
},
{
"range": {
"@timestamp": {
"gte": 1591567200000,
"lte": 1591740000000,
"format": "epoch_millis"
}
}
}
]
}
}
}
, where "gte": 1591567200000 and "lte": 1591740000000 are 09.06.2020 00:00 and 10.06.2020 00:00.
The problem is that even when I see new data in Discover section of Kibana - it is not returned by this query until middle of a day! Like there is some buffer for new records, or like that. And starting from ~15:00 - it works. And also works for any other day in the past. What is the reason for such a strange behaviour? And how to get the most recent records?