# Group\_concat equivalent

**URL:** <https://discuss.elastic.co/t/group-concat-equivalent/301222>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [March 31, 2022, 3:42pm UTC](https://discuss.elastic.co/t/group-concat-equivalent/301222 "2022-03-31T15:42:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![en666](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@en666](https://discuss.elastic.co/u/en666)\
**Post date:** [March 31, 2022, 3:42pm UTC](https://discuss.elastic.co/t/group-concat-equivalent/301222/1 "2022-03-31T15:42:46Z")

</div>

Hi all,

I've noticed that this very question was asked a number of times and always closed without an answer.

I am new to Elasticsearch and I've managed to GROUP the hits of a query BY multiple fields, which is good news. Last step I am missing is: inside your aggregated bucket you can then avg, sum, and all sorts of mathematical aggregations.

But I need to come out with a String that is the string concatenation of all the values in the bucket for a certain field. I guess I am literally searching for a GROUP\_CONCAT()-like functionality.

Any luck?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 28, 2022, 3:43pm UTC](https://discuss.elastic.co/t/group-concat-equivalent/301222/2 "2022-04-28T15:43:05Z")

</div>

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