title: Find Duplicate Documents in Elastic Search
body: <p>I'm looking for a solution to find duplicate(exact) Docs in ElasticSearch.
  I've read <a href="https://qbox.io/blog/minimizing-document-duplication-in-elasticsearch" rel="nofollow noreferrer">https://qbox.io/blog/minimizing-document-duplication-in-elasticsearch</a> and tried it but its results are not as I expected  as example this is my sample simple query :</p>
  
  <pre><code>GET /last_month_ads/_search
  {
    "size": 0,
    "fields": [
       "title"
    ], 
    "aggs": {
      "duplicateCount": {
        "terms": {
        "field": "title",
        "size" : 3        
        },
        "aggs": {
          "duplicateDocuments": {
            "top_hits": {}
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>and the result is </p>
  
  <pre><code>{
     "took": 981,
     "timed_out": false,
     "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
     },
     "hits": {
        "total": 482909,
        "max_score": 0,
        "hits": []
     },
     "aggregations": {
        "duplicateCount": {
           "doc_count_error_upper_bound": 11667,
           "sum_other_doc_count": 1958146,
           "buckets": [
              {
                 "key": "CM",
                 "doc_count": 46867,
                 "duplicateDocuments": {
                    "hits": {
                       "total": 46867,
                       "max_score": 1,
                       "hits": [
                          {
                             "_index": "last_month_ads",
                             "_type": "ads",
                             "_id": "AV73EtoBQTqkjEa7YQG1",
                             "_score": 1,
                             "_source": {
                                "id": "20642316",
                                "cat_id": "43606",
                                "user_id": "1825875",
                                "title": "125 CM HOME",
                                "desc": "DESC"
                             }
                          },
                          {
                             "_index": "last_month_ads",
                             "_type": "ads",
                             "_id": "AV73EtpdQTqkjEa7YQHc",
                             "_score": 1,
                             "_source": {
                                "id": "20642379",
                                "cat_id": "43604",
                                "user_id": "4642299",
                                "title": "Home with Big CM",
                                "desc": "DESC"
                             }
                          },
                          {
                             "_index": "last_month_ads",
                             "_type": "ads",
                             "_id": "AV73Etp6QTqkjEa7YQHp",
                             "_score": 1,
                             "_source": {
                                "id": "20642409",
                                "cat_id": "43607",
                                "user_id": "4813303",
                                "title": "100 of live CM is here ",
                                "desc": "DESC"
                             }
                          }
                       ]
                    }
                 }
              },
  
              }
           ]
        }
     }
  }
  </code></pre>
  
  <p><strong>I'm looking for Exact (or similar) titles not  abundance words in titles, how can I get get Duplicate(similar) Docs in Elastic Search?</strong></p>