# Date Histogram Facet with custom bucketing

**URL:** https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559
**Category:** Elasticsearch
**Created:** [February 3, 2014, 4:33pm UTC](https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559 "2014-02-03T16:33:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)
#### Post date: [February 3, 2014, 4:33pm UTC](https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559/1 "2014-02-03T16:33:02Z")

</div>

Hi All,

I need a facet that does exactly what Date Histogram Facet does, but I need  
a different (complicated) "monthly" bucketing.

Rather than the start/end of every month, I need a monthly period that  
begins/ends on "the friday before the 2nd wednesday" of every month....

Its been a little while since I last used Elastic - any pointers on how to  
go about this?

Many thanks.

-N

--  
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/05136160-bc0f-419f-9e34-d4ba4a319b76%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/05136160-bc0f-419f-9e34-d4ba4a319b76%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)
#### Post date: [February 11, 2014, 1:36pm UTC](https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559/2 "2014-02-11T13:36:39Z")

</div>

Bump?

On Monday, 3 February 2014 16:33:02 UTC, mooky wrote:

> Hi All,
> 
> I need a facet that does exactly what Date Histogram Facet does, but I  
> need a different (complicated) "monthly" bucketing.
> 
> Rather than the start/end of every month, I need a monthly period that  
> begins/ends on "the friday before the 2nd wednesday" of every month....
> 
> Its been a little while since I last used Elastic - any pointers on how to  
> go about this?
> 
> Many thanks.
> 
> -N

--  
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/73130c0f-f347-42cb-9910-28309e092874%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73130c0f-f347-42cb-9910-28309e092874%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [February 11, 2014, 1:52pm UTC](https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559/3 "2014-02-11T13:52:41Z")

</div>

Hey,

you can use the range facet, as it also supports dates and provide your own  
custom date ranges there maybe?  
See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Tue, Feb 11, 2014 at 2:36 PM, mooky [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com) wrote:

> Bump?
> 
> On Monday, 3 February 2014 16:33:02 UTC, mooky wrote:
> 
> > Hi All,
> > 
> > I need a facet that does exactly what Date Histogram Facet does, but I  
> > need a different (complicated) "monthly" bucketing.
> > 
> > Rather than the start/end of every month, I need a monthly period that  
> > begins/ends on "the friday before the 2nd wednesday" of every month....
> > 
> > Its been a little while since I last used Elastic - any pointers on how  
> > to go about this?
> > 
> > Many thanks.
> > 
> > -N
> 
> --  
> 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/73130c0f-f347-42cb-9910-28309e092874%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73130c0f-f347-42cb-9910-28309e092874%40googlegroups.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAGCwEM\_9aJde-UNavtd0mOnynTnBge%3D8hsVTA\_peOwSWkgoZQw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_9aJde-UNavtd0mOnynTnBge%3D8hsVTA_peOwSWkgoZQw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)
#### Post date: [February 21, 2014, 1:29pm UTC](https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559/4 "2014-02-21T13:29:03Z")

</div>

Thanks. It turns out that I have to create custom date ranges anyway - as  
the buckets are not uniform.

On Tuesday, 11 February 2014 13:52:41 UTC, Alexander Reelsen wrote:

> Hey,
> 
> you can use the range facet, as it also supports dates and provide your  
> own custom date ranges there maybe?  
> See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-range-facet.html)
> 
> --Alex
> 
> On Tue, Feb 11, 2014 at 2:36 PM, mooky \<[nick.mi...@gmail.com](mailto:nick.mi...@gmail.com) \<javascript:\>
> 
> > wrote:
> 
> > Bump?
> > 
> > On Monday, 3 February 2014 16:33:02 UTC, mooky wrote:
> > 
> > > Hi All,
> > > 
> > > I need a facet that does exactly what Date Histogram Facet does, but I  
> > > need a different (complicated) "monthly" bucketing.
> > > 
> > > Rather than the start/end of every month, I need a monthly period that  
> > > begins/ends on "the friday before the 2nd wednesday" of every month....
> > > 
> > > Its been a little while since I last used Elastic - any pointers on how  
> > > to go about this?
> > > 
> > > Many thanks.
> > > 
> > > -N
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/73130c0f-f347-42cb-9910-28309e092874%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73130c0f-f347-42cb-9910-28309e092874%40googlegroups.com)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/a8be4bc9-18bd-490c-b408-874023e42456%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8be4bc9-18bd-490c-b408-874023e42456%40googlegroups.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, 1:48am UTC](https://discuss.elastic.co/t/date-histogram-facet-with-custom-bucketing/15559/5 "2017-07-06T01:48:21Z")

</div>


