I'm using elasticsearch version 6.4.2
I succeeded to create a GET query using the REST API, now I would like to perform the same query using the JAVA api.
This is the query:
GET _search
{
"query":{
"bool":{
"must":{
"match":{
"tags":"kpi"
}
},
"filter":{
"range":{
"@timestamp":{
"gt":"now-5m"
}
}
}
}
}
}
I read this documentation: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-compound-queries.html but it is still not clear to me if this is I'm looking for and how to use it. Consider that the query could return a lot of results that have to be processed by my java application.
Also, since I have to perform this query every 5 minutes, how can I optimize it (if possible)?