title: How to find all duplicate documents in ElasticSearch
body: <p>We have a need to walk over all of the documents in our AWS ElasticSearch cluster, version 6.0, and gather a count of all the duplicate user ids.
  I have tried using a Data Visualization to aggregate counts on the user ids and export them, but the numbers don't match another source of our data that is searchable via traditional SQL. 
  What we would like to see is like this:
  USER ID   COUNT
  userid1   4
  userid22  3
  ...
  I am not an advanced Lucene query person and have yet to find an answer to this question. If anyone can provide some insight into how to do this, I would be appreciative.</p>