# How can I have an review of my index content on a specific field?

**URL:** <https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297>\
**Category:** Elasticsearch\
**Created:** [July 15, 2020, 1:02pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297 "2020-07-15T13:02:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vic22](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vic22](https://discuss.elastic.co/u/vic22)\
**Post date:** [July 15, 2020, 1:02pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297/1 "2020-07-15T13:02:19Z")

</div>

Hello everyone !  
I hope that you have a great day!  
I would like to ask you a particular question. It sounds easy, but, in contrario, it is quite complex...

In my Elasticsearch index, I would like to know for a specific field, what are all the possible values , for exemple, if my field is named "user", I want to know what are all the users referenced in this field ?

Thanks, in advance, for your answers!

Vic22

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [July 15, 2020, 1:08pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297/2 "2020-07-15T13:08:11Z")

</div>

You can use cardinality aggs to get an idea on how many unique values

```
GET my-index/_search
{
  "size": 0,
  "aggs": {
    "user_count": {
      "cardinality": {
        "field": "user",
        "precision_threshold": 100
      }
    }
  }
}

```

Then use a term aggs to retrieve all possible values

```
GET my-index/_search
{
  "size": 0,
  "aggs": {
    "users_buckets": {
      "terms": {
        "field": "user",
        "size": 1000
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![vic22](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vic22](https://discuss.elastic.co/u/vic22)\
**Post date:** [July 15, 2020, 1:49pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297/3 "2020-07-15T13:49:41Z")

</div>

[quote="ylasri, post:2, topic:241297"]

```auto
GET my-index/_search
{
  "size": 0,
  "aggs": {
    "user_count": {
      "cardinality": {
        "field": "user",
        "precision_threshold": 100
      }
    }
  }
}

```

Ok, thank you !

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [July 15, 2020, 1:54pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297/4 "2020-07-15T13:54:13Z")

</div>

Or simply use the Data Visualiser under Machine Learning in Kibana to explore your index  
That will give you an overview on your index

---

<div class="post-metadata">

**Author:** ![vic22](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vic22](https://discuss.elastic.co/u/vic22)\
**Post date:** [July 15, 2020, 3:10pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297/5 "2020-07-15T15:10:24Z")

</div>

I do not have yet Kibana, I am only requesting Elasticsearch in curl command. But I will remember your advise. Again Thank You !

---

<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:** [August 12, 2020, 3:17pm UTC](https://discuss.elastic.co/t/how-can-i-have-an-review-of-my-index-content-on-a-specific-field/241297/6 "2020-08-12T15:17:05Z")

</div>

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