# Retrieving the duplicate records with count more than 2 - JAVA API

**URL:** <https://discuss.elastic.co/t/retrieving-the-duplicate-records-with-count-more-than-2-java-api/75556>\
**Category:** Elasticsearch\
**Created:** [February 17, 2017, 8:33pm UTC](https://discuss.elastic.co/t/retrieving-the-duplicate-records-with-count-more-than-2-java-api/75556 "2017-02-17T20:33:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thinkdffrnt](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@thinkdffrnt](https://discuss.elastic.co/u/thinkdffrnt)\
**Post date:** [February 17, 2017, 8:33pm UTC](https://discuss.elastic.co/t/retrieving-the-duplicate-records-with-count-more-than-2-java-api/75556/1 "2017-02-17T20:33:11Z")

</div>

I have data something like below in ES. I want to retrieve the duplicate records of all customer names whose count is equal or more than 2 using Java API. I'm using 2.x version.

[  
{  
"customer": "anna",  
"state": "TX"  
},  
{  
"customer": "peter",  
"state": "NY"  
},  
{  
"customer": "anna",  
"state": "WY"  
},  
{  
"customer": "peter",  
"state": "WY"  
},  
{  
"customer": "Mike",  
"state": "CO"  
}  
]

---

<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:** [March 17, 2017, 8:33pm UTC](https://discuss.elastic.co/t/retrieving-the-duplicate-records-with-count-more-than-2-java-api/75556/2 "2017-03-17T20:33:22Z")

</div>

Closed on March 17, 2017, 8:33pm UTC

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