# Have any way to get how many different value in one field?

**URL:** <https://discuss.elastic.co/t/have-any-way-to-get-how-many-different-value-in-one-field/33832>\
**Category:** Elasticsearch\
**Created:** [November 5, 2015, 6:38am UTC](https://discuss.elastic.co/t/have-any-way-to-get-how-many-different-value-in-one-field/33832 "2015-11-05T06:38:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NgocPham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ngocpham/32/6242_2.png) [@NgocPham](https://discuss.elastic.co/u/NgocPham)\
**Post date:** [November 5, 2015, 6:38am UTC](https://discuss.elastic.co/t/have-any-way-to-get-how-many-different-value-in-one-field/33832/1 "2015-11-05T06:38:08Z")

</div>

sorry, im newbie and i have one question.

Im wondering about one issue, it is : have any way to know how many different value in one field in elasticsearch?

Example : name index is :twitter , type tweet , field user . And in field user have some value about  
id user  
1 Mr.A  
2 Mr.B  
3 Mr.C  
4 Mr.A

Have any way elasticsearch know how many different user in this ? , in my example is 3 : Mr.A,Mr.B,Mr.C  
i think maybe can use filter script but i dont know how to do .

Thanks for your help ☀

---

<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:** [July 5, 2017, 11:40pm UTC](https://discuss.elastic.co/t/have-any-way-to-get-how-many-different-value-in-one-field/33832/2 "2017-07-05T23:40:26Z")

</div>


