# Elastic search, unique query result

**URL:** <https://discuss.elastic.co/t/elastic-search-unique-query-result/9403>\
**Category:** Elasticsearch\
**Created:** [October 18, 2012, 7:11am UTC](https://discuss.elastic.co/t/elastic-search-unique-query-result/9403 "2012-10-18T07:11:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@Cem](https://discuss.elastic.co/u/Cem)\
**Post date:** [October 18, 2012, 7:11am UTC](https://discuss.elastic.co/t/elastic-search-unique-query-result/9403/1 "2012-10-18T07:11:23Z")

</div>

Imagine the following data :

data: [  
{ A: 1  
B: 1  
C: 1  
}  
{ A: 1  
B: 1  
C: 2  
}  
{ A: 3  
B: 1  
C: 23  
}  
...  
]

When I query, I would like to receive every data that has its value B as 1,  
but I don't want them to share the same A value. In other words I would  
like my query result to contain unique A values. So in this example I would  
have either C = 2, 23 or C = 1, 23. Is this achievable in elastic search ?

--

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [October 18, 2012, 7:31am UTC](https://discuss.elastic.co/t/elastic-search-unique-query-result/9403/2 "2012-10-18T07:31:29Z")

</div>

Hi Cem

> When I query, I would like to receive every data that has its value B  
> as 1, but I don't want them to share the same A value. In other words  
> I would like my query result to contain unique A values. So in this  
> example I would have either C = 2, 23 or C = 1, 23. Is this achievable  
> in Elasticsearch ?

No. This is something you would need to solve client side

clint

> --

--

---

<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 6, 2017, 3:08am UTC](https://discuss.elastic.co/t/elastic-search-unique-query-result/9403/3 "2017-07-06T03:08:11Z")

</div>


