This is my elasticsearch query that intends to filter data between 11 pm and 12 pm on the day 2015.08.04. But it doesn't filter and gives many errors.
"query" : {"range" :
{"@timestamp" :
{"gt" : "2015-08-04 11:00:00", "lt" : "2015-08-04 12:00:00"}
}
}
Range Queries in Elasticsearch Combining the greater than ( gt ) and less than ( lt ) range parameters is an effective way to search for documents that contain a certain field value within a range where you know the upper and lower bounds. In this example, we can find all cars that were made in 2016, 2017, and 2018: 1.
must means: Clauses that must match for the document to be included. should means: If these clauses match, they increase the _score ; otherwise, they have no effect. They are simply used to refine the relevance score for each document.
It works with the following query
{
"query":{
"range":{
"@timestamp":{
"gte":"2015-08-04T11:00:00",
"lt":"2015-08-04T12:00:00"
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With