Working on a watcher, similar to Flatten nested aggregation
but as I am still using ES 5.5, no composition agg avaiable
in my query, i have a cascade of aggregations:
{
aggs: {
A
aggs: {
B
aggs: {
C
}
}
}
}
In my watcher transform, I want to flatten the result to a list in case that buckets is not empty:
[ { A1.key, B1.key, C1.key },
{ A1.key, B1.key, C2.key },
{ A2.key, B2.key, C1.key } ... ]
want to find an easy way instead of loop the for, any suggestion, thank you in advance.