Working on a transform for elasticsearch query result
{
'key': factoryA,
'buckets': [
{
'key': 'productX'
}
]
},
{
'key': factoryB,
'buckets': [
{
'key': 'productX'
},
{
'key': 'productY'
}
]
}
I want to have a list whose item is a combination of aggregation on factory and its nested aggregation products:
[
{'factory': 'factoryA', 'product': 'productX'},
{'factory': 'factoryB', 'product': 'productX'},
{'factory': 'factoryB', 'product': 'productY'},
]
any advice on painless script ? Thank you in advance. Or any place I can find a comprehensive guide for painless. Painless without Doc is totally painful.