I'm trying to use an Elasticsearch aggregation to 'merge' an array of integers based on a set of filters. I have documents that look like:
{
"arr": [5, 4, 3, 2, 1],
"name": "test"
}
{
"arr": [4, 3, 2, 1, 0],
"name": "test"
}
{
"arr": [1, 0, 0, 0, 0],
"name": "test"
}
I want to use an aggregation (or some other es method) to return
{
"arr": [10, 7, 5, 3, 1]
}