Hi All,
I would like to do a simple count aggregation from a distinct list of my union of two nested list. But I have no idea, how can i do this.
This is my sample structure:
"_source": {
"productId": 1,
"materialMain": [
{
"name": "Wood",
"id": 15
},
{
"name": "Oak",
"id": 151
}],
"materialSecondary": [
{
"name": "Wood",
"id": 15
},
{
"name": "Spruce",
"id": 152
}]
}
The accepted result should be:
Wood, Id:15, count = 1
Oak, Id:151, count = 1
Spruce, Id: 152, count = 1
Thank you for your help in advance!
Csaba