# Extended bounds on auto-interval date histogram

**URL:** <https://discuss.elastic.co/t/extended-bounds-on-auto-interval-date-histogram/280904>\
**Category:** Elasticsearch\
**Created:** [August 10, 2021, 9:41am UTC](https://discuss.elastic.co/t/extended-bounds-on-auto-interval-date-histogram/280904 "2021-08-10T09:41:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rooch/32/92752_2.png) [@rooch](https://discuss.elastic.co/u/rooch)\
**Post date:** [August 10, 2021, 9:41am UTC](https://discuss.elastic.co/t/extended-bounds-on-auto-interval-date-histogram/280904/1 "2021-08-10T09:41:43Z")

</div>

I need to be able to run a query with a set of filters and an auto-interval date histogram aggregation to retrieve a set of bins. I then need to be able to rerun that query but with additional filters, and receive exactly the same bins (albeit with different counts). The problem I have is that the new filters after the date range of the result set (and therefore the bins).

I think being able to set extended\_bounds for an auto-interval aggregation would solve this, but that feature is only available on the regular date histogram.

Another potential solution would be to build a date histogram aggregation using extended bounds and the interval returned from the auto-interval histogram. The problem here is that the returned interval is incompatible with with either the calendarInterval or fixedInterval parameters of the date histogram (I can't use `5y` for example).

Does anyone have any other suggestions on how I can solve this?

Thanks in advance.

---

<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 7, 2021, 9:41am UTC](https://discuss.elastic.co/t/extended-bounds-on-auto-interval-date-histogram/280904/2 "2021-09-07T09:41:52Z")

</div>

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