# How to get the count of duplicate documents based on a field value?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-count-of-duplicate-documents-based-on-a-field-value/189614>\
**Category:** Elasticsearch\
**Created:** [July 9, 2019, 7:22pm UTC](https://discuss.elastic.co/t/how-to-get-the-count-of-duplicate-documents-based-on-a-field-value/189614 "2019-07-09T19:22:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveengadugin1](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@praveengadugin1](https://discuss.elastic.co/u/praveengadugin1)\
**Post date:** [July 9, 2019, 7:22pm UTC](https://discuss.elastic.co/t/how-to-get-the-count-of-duplicate-documents-based-on-a-field-value/189614/1 "2019-07-09T19:22:33Z")

</div>

i have an index of 14 million docs. (2.5 TB). I suspect there are around 2 million duplicates in that. I want to get the exact count of documents which have more than one copy. I want to do this based on a field which we know is unique to all those documents.  
( i know the query to get all duplicates. I need a query to get only the count )  
like count if min\_doc= 2  
count if FieldValue\>=2

---

<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:** [August 6, 2019, 7:22pm UTC](https://discuss.elastic.co/t/how-to-get-the-count-of-duplicate-documents-based-on-a-field-value/189614/2 "2019-08-06T19:22:34Z")

</div>

Closed on August 6, 2019, 7:22pm UTC

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