# CompositeAgg DateHistograms - fill empty interval gaps & key\_as\_string like normal DateHistogramAgg

**URL:** <https://discuss.elastic.co/t/compositeagg-datehistograms-fill-empty-interval-gaps-key-as-string-like-normal-datehistogramagg/278271>\
**Category:** Elasticsearch\
**Created:** [July 9, 2021, 10:37am UTC](https://discuss.elastic.co/t/compositeagg-datehistograms-fill-empty-interval-gaps-key-as-string-like-normal-datehistogramagg/278271 "2021-07-09T10:37:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xskerik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xskerik/32/85243_2.png) [@xskerik](https://discuss.elastic.co/u/xskerik)\
**Post date:** [July 9, 2021, 10:37am UTC](https://discuss.elastic.co/t/compositeagg-datehistograms-fill-empty-interval-gaps-key-as-string-like-normal-datehistogramagg/278271/1 "2021-07-09T10:37:25Z")

</div>

This is basically follow up of issue [CompositeAgg Histograms - fill empty interval gaps like normal histogramAggregation](https://discuss.elastic.co/t/compositeagg-histograms-fill-empty-interval-gaps-like-normal-histogramaggregation/180296)

It would be nice if DateHistogram under Composite agg behaves more like plain DateHistogram.  
IDK if this is bug or feature, but it would be handy when Composite DateHistogram supports

- empty buckets
- returning key not only as timestamp but key\_as\_string too.

The motivation for this is to easily implement bucket paging on existing solution. Non of these problems are described in the documentation.

Zdenek

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 12, 2021, 8:40am UTC](https://discuss.elastic.co/t/compositeagg-datehistograms-fill-empty-interval-gaps-key-as-string-like-normal-datehistogramagg/278271/2 "2021-07-12T08:40:21Z")

</div>

If you think that this is a valid feature, feel free to open an issue in the [Elasticsearch GitHub repository](https://github.com/elastic/elasticsearch/issues/new/choose)

---

<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:** [August 9, 2021, 8:40am UTC](https://discuss.elastic.co/t/compositeagg-datehistograms-fill-empty-interval-gaps-key-as-string-like-normal-datehistogramagg/278271/3 "2021-08-09T08:40:40Z")

</div>

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