# \[JSON Input\] Is there a max\_doc\_count filtering function similar to min\_doc\_count?

**URL:** https://discuss.elastic.co/t/json-input-is-there-a-max-doc-count-filtering-function-similar-to-min-doc-count/113035
**Category:** Kibana
**Created:** [December 22, 2017, 4:29pm UTC](https://discuss.elastic.co/t/json-input-is-there-a-max-doc-count-filtering-function-similar-to-min-doc-count/113035 "2017-12-22T16:29:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![steno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steno/32/35546_2.png) [@steno](https://discuss.elastic.co/u/steno)
#### Post date: [December 22, 2017, 4:29pm UTC](https://discuss.elastic.co/t/json-input-is-there-a-max-doc-count-filtering-function-similar-to-min-doc-count/113035/1 "2017-12-22T16:29:47Z")

</div>

Hi there,  
I was wondering if there is a max\_doc\_count with the opposite behaviour of [min\_doc\_count](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_minimum_document_count_4).

I was trying to show in a Kibana 6.1 Data Table visualization only the terms that sums up to a maximum number of 1 hits and puzzling on what to write on JSON Input...  
I used a Sum Bucket aggregation and a Terms aggregation.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [December 26, 2017, 6:03pm UTC](https://discuss.elastic.co/t/json-input-is-there-a-max-doc-count-filtering-function-similar-to-min-doc-count/113035/2 "2017-12-26T18:03:17Z")

</div>

It looks like that doesn't exist in Elasticsearch. My guess is that feature isn't available because to get that kind seems like it would have a high impact on node performance.

---

<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: [January 23, 2018, 6:03pm UTC](https://discuss.elastic.co/t/json-input-is-there-a-max-doc-count-filtering-function-similar-to-min-doc-count/113035/3 "2018-01-23T18:03:18Z")

</div>

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