# Simple metric with count not respecting min\_doc\_count parameter

**URL:** <https://discuss.elastic.co/t/simple-metric-with-count-not-respecting-min-doc-count-parameter/98993>\
**Category:** Kibana\
**Created:** [August 31, 2017, 11:39am UTC](https://discuss.elastic.co/t/simple-metric-with-count-not-respecting-min-doc-count-parameter/98993 "2017-08-31T11:39:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Juma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_juma/32/21704_2.png) [@Alexandre\_Juma](https://discuss.elastic.co/u/Alexandre_Juma)\
**Post date:** [August 31, 2017, 11:39am UTC](https://discuss.elastic.co/t/simple-metric-with-count-not-respecting-min-doc-count-parameter/98993/1 "2017-08-31T11:39:20Z")

</div>

Hi all,

I'm trying to set up a dashboard with several metrics with custom colors where the metric is a simple count of documents in the index in a specific time interval.

When there are no records in the index, "no results found" is displayed instead of 0, even when { "min\_doc\_count": 0 } is defined to 0.

 ![snippet](https://us1.discourse-cdn.com/elastic/original/3X/2/0/20da2a127b13f8842ca864f0eba1fed9f07d1caa.JPG)

Should this be the standard behaviour?

Many thanks

BR  
Alex

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [August 31, 2017, 2:09pm UTC](https://discuss.elastic.co/t/simple-metric-with-count-not-respecting-min-doc-count-parameter/98993/2 "2017-08-31T14:09:14Z")

</div>

Hi @Alexandre_Juma,

the min\_doc\_count is a parameter of the aggregations. so you could add this for example for a 'Histogram', or a 'Terms' aggregations, but not for a metric.

Are you sure there are documents in the time-range that is selected for Kibana? For your specific configuration, this is default behaviour in Kibana, because it allows you to see the difference between "no data" and actual 0-valued metric.

The way you could work-around is use a 'Date Range' aggregation, and specify the date-range you are interested in.

For example:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/f/0feb432080d3910feb523a9558c3bd150f54b80b.png)

thx,

---

<div class="post-metadata">

**Author:** ![Alexandre\_Juma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_juma/32/21704_2.png) [@Alexandre\_Juma](https://discuss.elastic.co/u/Alexandre_Juma)\
**Post date:** [August 31, 2017, 2:31pm UTC](https://discuss.elastic.co/t/simple-metric-with-count-not-respecting-min-doc-count-parameter/98993/3 "2017-08-31T14:31:52Z")

</div>

> [@thomasneirynck](#):
>
> The way you could work-around is use a ‘Date Range’ aggregation, and specify the date-range you are interested in.

Hi Thomas,

Thanks for the tip. It's working now!

I tought I was doing exactly the same by defining In the filter box (as shown in my screenshot):

> @timestamp:[now-10m/m TO now]

Apparently not 🙂

Best Regards  
Alexandre

---

<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:** [September 28, 2017, 2:32pm UTC](https://discuss.elastic.co/t/simple-metric-with-count-not-respecting-min-doc-count-parameter/98993/4 "2017-09-28T14:32:13Z")

</div>

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