# Date histogram facet problem: bucket distribution

**URL:** <https://discuss.elastic.co/t/date-histogram-facet-problem-bucket-distribution/12915>\
**Category:** Elasticsearch\
**Created:** [July 24, 2013, 4:56am UTC](https://discuss.elastic.co/t/date-histogram-facet-problem-bucket-distribution/12915 "2013-07-24T04:56:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhoutuo\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zhoutuo_yang/32/2211_2.png) [@Zhoutuo\_Yang](https://discuss.elastic.co/u/Zhoutuo_Yang)\
**Post date:** [July 24, 2013, 4:56am UTC](https://discuss.elastic.co/t/date-histogram-facet-problem-bucket-distribution/12915/1 "2013-07-24T04:56:22Z")

</div>

Hi folks,  
I'm using logstash with elasticsearch, whose indices store logs by days  
When doing the date histogram across multiple days, It will involves same  
number of indices.  
Since I'm using D3 to visualize the chart, I want to do multiple ajax calls  
to backend index by index (namely day by day) and populate the chart  
gradually within several calls.  
Here is the problem, there is an "interval" parameter for date histogram  
which is size of each bucket.  
If I put "5h" for interval and do a two-day facet,  
for first day, the bucket will be 12am - 5am 5am-10am 10am-3pm 3pm-8pm  
8pm-12am(which is short of one hour), the second day will have the same  
distribution of buckets.  
Since I can not combine these two arrays of buckets together (8pm-12am on  
the first day is not a 5h bucket), is there any other way to achieve except  
make sure that interval is divisor of a day?  
The above distributions are my assumptions, plz correct me if i'm wrong.  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:24am UTC](https://discuss.elastic.co/t/date-histogram-facet-problem-bucket-distribution/12915/2 "2017-07-06T02:24:53Z")

</div>


