# Get all values for a given field?

**URL:** <https://discuss.elastic.co/t/get-all-values-for-a-given-field/179014>\
**Category:** Elasticsearch\
**Created:** [April 30, 2019, 5:53am UTC](https://discuss.elastic.co/t/get-all-values-for-a-given-field/179014 "2019-04-30T05:53:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evelyn38](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@Evelyn38](https://discuss.elastic.co/u/Evelyn38)\
**Post date:** [April 30, 2019, 5:53am UTC](https://discuss.elastic.co/t/get-all-values-for-a-given-field/179014/1 "2019-04-30T05:53:34Z")

</div>

Is it possible to query for all of the values a specific field?

Say I have "articles" and each article has an author, is there a query [I](https://www.dqfanfeedback.xyz/) can perform to find a list of all authors?

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [April 30, 2019, 11:39am UTC](https://discuss.elastic.co/t/get-all-values-for-a-given-field/179014/2 "2019-04-30T11:39:53Z")

</div>

Take a look at the [terms aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html). By default, it returns you the 10 most common values for a field. You can provide a [`size` parameter](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size) to get more values than just the top 10 values.

If you would like to retrieve all the values, rather than just the top X most common values, then you can wrap the terms aggregation in a [composite aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html).

---

<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:** [May 28, 2019, 11:39am UTC](https://discuss.elastic.co/t/get-all-values-for-a-given-field/179014/3 "2019-05-28T11:39:59Z")

</div>

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