Hi I am new to Elasticsearch, and I'm writing a query using sub aggregations. I'm not sure whether it is okay in terms of performance or any other alternatives exist. please guide me.
the query looks like this
{
"size": 0,
"aggs": {
"status": {
"terms": {
"field": "status"
},
"aggs": {
"date_buckets": {
"date_range": {
"field": "@timestamp",
"ranges": [
{
"key": "Today",
"from": "2022-04-28T05:30:00.000+0530",
"to": "2022-04-29T05:30:00.000+0530"
},
{
"key": "Past",
"from": "2020-04-27T05:30:00.000+0530",
"to": "2022-04-28T05:30:00.000+0530"
},
{
"key": "Future",
"from": "2022-05-28T05:30:00.000+0530",
"to": "2023-04-29T05:30:00.000+0530"
}
]
}
}
}
}
}
}