# Get all documents of having unique value with elasticsearch

**URL:** <https://discuss.elastic.co/t/get-all-documents-of-having-unique-value-with-elasticsearch/124900>\
**Category:** Elasticsearch\
**Created:** [March 21, 2018, 3:54am UTC](https://discuss.elastic.co/t/get-all-documents-of-having-unique-value-with-elasticsearch/124900 "2018-03-21T03:54:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lwpk110](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@lwpk110](https://discuss.elastic.co/u/lwpk110)\
**Post date:** [March 21, 2018, 3:54am UTC](https://discuss.elastic.co/t/get-all-documents-of-having-unique-value-with-elasticsearch/124900/1 "2018-03-21T03:54:06Z")

</div>

for example:  
i have many documents like this:  
email status  
[1@123.com](mailto:1@123.com) open  
[1@123.com](mailto:1@123.com) click  
[2@123.com](mailto:2@123.com) open  
[3@123.com](mailto:3@123.com) open

i will query all documents with unique status value :"open", due to the record "1@123.com" contains "click" status, so "1@123.com" don't expect!

my expect response like this:  
[2@123.com](mailto:2@123.com) open  
[3@123.com](mailto:3@123.com) open

How can i do this job,tks..

link : https://stackoverflow.com/questions/49399197/get-all-documents-of-having-unique-value-with-elastic

---

<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:** [April 18, 2018, 3:54am UTC](https://discuss.elastic.co/t/get-all-documents-of-having-unique-value-with-elasticsearch/124900/2 "2018-04-18T03:54:41Z")

</div>

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