# Remove duplicate documents from a search in kibana4

**URL:** https://discuss.elastic.co/t/remove-duplicate-documents-from-a-search-in-kibana4/26453
**Category:** Kibana
**Created:** [July 29, 2015, 3:10am UTC](https://discuss.elastic.co/t/remove-duplicate-documents-from-a-search-in-kibana4/26453 "2015-07-29T03:10:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vincentTulip](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vincentTulip](https://discuss.elastic.co/u/vincentTulip)
#### Post date: [July 29, 2015, 3:10am UTC](https://discuss.elastic.co/t/remove-duplicate-documents-from-a-search-in-kibana4/26453/1 "2015-07-29T03:10:35Z")

</div>

I have an index with a lot of paper with the same value for the same field. I have one deduplication on this field.

Aggregators will come to me as counters. I would like a list of documents.

My index :

Doc 1 {domain: 'domain1.fr', name: 'name1', date: '01-01-2014'}  
Doc 2 {domain: 'domain1.fr', name: 'name1', date: '01-02-2014'}  
Doc 3 {domain: 'domain2.fr', name: 'name2', date: '01-03-2014'}  
Doc 4 {domain: 'domain2.fr', name: 'name2', date: '01-04-2014'}  
Doc 5 {domain: 'domain3.fr', name: 'name3', date: '01-05-2014'}  
Doc 6 {domain: 'domain3.fr', name: 'name3', date: '01-06-2014'}  
I want this result (deduplication result by domain field) :

Doc 6 {domain: 'domain3.fr', name: 'name3', date: '01-06-2014'}  
Doc 4 {domain: 'domain2.fr', name: 'name2', date: '01-04-2014'}  
Doc 2 {domain: 'domain1.fr', name: 'name1', date: '01-02-2014'}

i search use this:

```
/POST http://localhost:9200/test/dedup/_search?search_type=count&pretty=true
{
 "aggs":{
"dedup" : {
  "terms":{
    "field": "name"
   },
   "aggs":{
     "dedup_docs":{
       "top_hits":{
         "size":1
       }
     }
   }    
  }
 }
}

```

how can i show in kibana 4?

---

<div class="post-metadata">

### Author: ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)
#### Post date: [July 30, 2015, 4:17am UTC](https://discuss.elastic.co/t/remove-duplicate-documents-from-a-search-in-kibana4/26453/2 "2015-07-30T04:17:32Z")

</div>

Kibana does not yet support the top hits aggregation, but please feel free to +1 this issue: [https://github.com/elastic/kibana/issues/3546](https://github.com/elastic/kibana/issues/3546)

---

<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: [July 6, 2017, 2:15pm UTC](https://discuss.elastic.co/t/remove-duplicate-documents-from-a-search-in-kibana4/26453/3 "2017-07-06T14:15:39Z")

</div>


