# Retrieving distinct values of a field

**URL:** <https://discuss.elastic.co/t/retrieving-distinct-values-of-a-field/147675>\
**Category:** Elasticsearch\
**Created:** [September 7, 2018, 8:13am UTC](https://discuss.elastic.co/t/retrieving-distinct-values-of-a-field/147675 "2018-09-07T08:13:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetansk](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@chetansk](https://discuss.elastic.co/u/chetansk)\
**Post date:** [September 7, 2018, 8:13am UTC](https://discuss.elastic.co/t/retrieving-distinct-values-of-a-field/147675/1 "2018-09-07T08:13:30Z")

</div>

Hi,

I would like to retrieve only the distinct values of a particular field in elasticsearch query. For instance, my search term is resulting into same user multiple times.I would like to have a particular user's info only once. What should be the way to achieve it?  
Looking for suggestions/help.

Thanks.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 11, 2018, 10:26am UTC](https://discuss.elastic.co/t/retrieving-distinct-values-of-a-field/147675/2 "2018-09-11T10:26:46Z")

</div>

Try [Field Collapsing](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-collapse.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:** [October 9, 2018, 10:40am UTC](https://discuss.elastic.co/t/retrieving-distinct-values-of-a-field/147675/3 "2018-10-09T10:40:34Z")

</div>

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