# Limit terms bucket to results with more than one document

**URL:** https://discuss.elastic.co/t/limit-terms-bucket-to-results-with-more-than-one-document/165626
**Category:** Kibana
**Created:** [January 24, 2019, 3:17pm UTC](https://discuss.elastic.co/t/limit-terms-bucket-to-results-with-more-than-one-document/165626 "2019-01-24T15:17:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![programagor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programagor/32/40183_2.png) [@programagor](https://discuss.elastic.co/u/programagor)
#### Post date: [January 24, 2019, 3:18pm UTC](https://discuss.elastic.co/t/limit-terms-bucket-to-results-with-more-than-one-document/165626/1 "2019-01-24T15:18:00Z")

</div>

Greetings

I would like to create a table showing buckets with two or more documents in it. I have been able to create a table showing the top n buckets, but most of those have just 1 document in them:

 ![Terms](https://us1.discourse-cdn.com/elastic/original/3X/6/0/6080b651c6a0477df0c712387b39cac6e394a388.png)  
In the example above, I would like to display only the first 3 results (the ones where the Count is greater than 1).

Is there a way to achieve this?

---

<div class="post-metadata">

### Author: ![programagor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programagor/32/40183_2.png) [@programagor](https://discuss.elastic.co/u/programagor)
#### Post date: [January 24, 2019, 3:20pm UTC](https://discuss.elastic.co/t/limit-terms-bucket-to-results-with-more-than-one-document/165626/2 "2019-01-24T15:20:04Z")

</div>

I figured it out, the solution was to put `{"min_doc_count": 2}` in the JSON Input of the Terms bucket.

 ![Terms](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6d6132977826eb71c99ca426035c814e2b142380.png)

---

<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: [February 21, 2019, 3:27pm UTC](https://discuss.elastic.co/t/limit-terms-bucket-to-results-with-more-than-one-document/165626/3 "2019-02-21T15:27:46Z")

</div>

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