Concat String results in aggregation

He, I'm trying build a query with aggregation included, the aggregation define a sum of numeric values and i need further retrieve the _ids list of items concatenated ... this is part of my aggregation ...

     "aggs": {
            "group_by_balance_currency": {
                "terms": {
                    "field": "balance_currency.keyword",
                    "size": 500000,
                    "order": {
                        "_key": "asc"
                    }
                },
                "aggs": {
                    "sum_of_amount": {
                        "sum": {
                            "field": "balance_amount"
                        }
                    }
                }
            },
            // Here I need concat _id of items
           
         }
      }

The key of problem is how concat de _id separated by comma in the second part of aggregation, just in comment place.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.