# ES Date Histogram Bucket max item count

**URL:** <https://discuss.elastic.co/t/es-date-histogram-bucket-max-item-count/22232>\
**Category:** Elasticsearch\
**Created:** [February 18, 2015, 10:06am UTC](https://discuss.elastic.co/t/es-date-histogram-bucket-max-item-count/22232 "2015-02-18T10:06:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil\_varnas](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@neil\_varnas](https://discuss.elastic.co/u/neil_varnas)\
**Post date:** [February 18, 2015, 10:06am UTC](https://discuss.elastic.co/t/es-date-histogram-bucket-max-item-count/22232/1 "2015-02-18T10:06:44Z")

</div>

I have timeSeries based data.

Im performing a date histogram aggregation with interval '1h' and sorting  
the results by "\_count". Is it possible to limit the item count in the  
bucket so it would only return the 1st one, the item with the maximum count  
and not bother about the other ?

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/29d5a9b7-32a5-4c0b-9d69-84b377770d68%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/29d5a9b7-32a5-4c0b-9d69-84b377770d68%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:31am UTC](https://discuss.elastic.co/t/es-date-histogram-bucket-max-item-count/22232/2 "2017-07-06T00:31:57Z")

</div>


