# Elasticsearch 2.4.6 return an array of all values for a field for a bucket in aggregation

**URL:** <https://discuss.elastic.co/t/elasticsearch-2-4-6-return-an-array-of-all-values-for-a-field-for-a-bucket-in-aggregation/132430>\
**Category:** Elasticsearch\
**Created:** [May 18, 2018, 7:34am UTC](https://discuss.elastic.co/t/elasticsearch-2-4-6-return-an-array-of-all-values-for-a-field-for-a-bucket-in-aggregation/132430 "2018-05-18T07:34:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mushroomlog](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mushroomlog](https://discuss.elastic.co/u/mushroomlog)\
**Post date:** [May 18, 2018, 7:34am UTC](https://discuss.elastic.co/t/elasticsearch-2-4-6-return-an-array-of-all-values-for-a-field-for-a-bucket-in-aggregation/132430/1 "2018-05-18T07:34:29Z")

</div>

I am doing a complex aggregation which involves nested buckets and filters.  
I want to then return an array of all values for field [x] in this filtered bucket.  
Is that possible?

Something that will return

```auto
"bucket":{
  "max_age":{
    "value":53 
  },
  "list_of_names":{
     ["John","James","Fred"]
  }
}

```

---

<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:** [June 15, 2018, 7:34am UTC](https://discuss.elastic.co/t/elasticsearch-2-4-6-return-an-array-of-all-values-for-a-field-for-a-bucket-in-aggregation/132430/2 "2018-06-15T07:34:30Z")

</div>

Closed on June 15, 2018, 7:34am UTC

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