# Listing all values of one field

**URL:** <https://discuss.elastic.co/t/listing-all-values-of-one-field/172784>\
**Category:** Elasticsearch\
**Created:** [March 18, 2019, 1:44pm UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784 "2019-03-18T13:44:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DidierB](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@DidierB](https://discuss.elastic.co/u/DidierB)\
**Post date:** [March 18, 2019, 1:44pm UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784/1 "2019-03-18T13:44:53Z")

</div>

Hello,

I have a big index (in fact many: one per day) with a field "id". I would like to know each value that this field has. The classical answer is :

```
{
  "size": 0,
  "aggs": {
    "2": {
      "terms": {
        "field": "id.keyword",
        "size": 100
      }
    }
  }
}

```

This is working! However it doesn't help me because:

- I need all the values, not the top 100
- I have a cardinality of millions and the 12 big server ES is hanging with size = 100000

However:

- I don't need to order the fields
- I don't need the counts

Is there a way to just get the list of the values of "id.keyword"?

/EDIT/ I'm using a 6.0.0 version of ES.

---

<div class="post-metadata">

**Author:** ![DidierB](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@DidierB](https://discuss.elastic.co/u/DidierB)\
**Post date:** [March 19, 2019, 7:57am UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784/2 "2019-03-19T07:57:56Z")

</div>

I forgot to mention, I'm using ES 6.0.0.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 20, 2019, 8:27am UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784/3 "2019-03-20T08:27:28Z")

</div>

You could take a look at the [composite aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-aggregations-bucket-composite-aggregation.html), allowing you to paginate through all buckets.

---

<div class="post-metadata">

**Author:** ![DidierB](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@DidierB](https://discuss.elastic.co/u/DidierB)\
**Post date:** [March 20, 2019, 8:54am UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784/4 "2019-03-20T08:54:56Z")

</div>

Unfortunately, the composite aggregation is not available for 6.0.0 Elasticsearch.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 20, 2019, 9:01am UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784/5 "2019-03-20T09:01:34Z")

</div>

Sounds like a potentially good reason to upgrade to a more recent release.

---

<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 17, 2019, 9:01am UTC](https://discuss.elastic.co/t/listing-all-values-of-one-field/172784/6 "2019-04-17T09:01:35Z")

</div>

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