# Bulk Query - Get Unique results

**URL:** <https://discuss.elastic.co/t/bulk-query-get-unique-results/49782>\
**Category:** Elasticsearch\
**Created:** [May 11, 2016, 2:51pm UTC](https://discuss.elastic.co/t/bulk-query-get-unique-results/49782 "2016-05-11T14:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajmariella](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@ajmariella](https://discuss.elastic.co/u/ajmariella)\
**Post date:** [May 11, 2016, 2:51pm UTC](https://discuss.elastic.co/t/bulk-query-get-unique-results/49782/1 "2016-05-11T14:51:45Z")

</div>

If I have data in ES that looks like this:  
{ (name: 'Steve Rogers', city: 'New York', color: 'Blue'),  
(name: 'Tony Stark', city; 'Los Angeles', color 'gold'),  
(name: 'Bruce Banner', city: 'New York', color: 'green'),  
(name: 'Peter Parker', city: 'New York', color: 'red'),  
...  
}  
I want to run a bulk query and pull out all the unique names. If my data is 17M records, how can I pull back all the  
data quickly ? All in JAVA

I'd also like to run a query and bring back all the unique combinations of name, city.

---

<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, 10:52pm UTC](https://discuss.elastic.co/t/bulk-query-get-unique-results/49782/2 "2017-07-05T22:52:27Z")

</div>

Closed on July 5, 2017, 10:52pm UTC


