# Problem with Date Histogram Facet

**URL:** https://discuss.elastic.co/t/problem-with-date-histogram-facet/13912
**Category:** Elasticsearch
**Created:** [October 10, 2013, 9:42pm UTC](https://discuss.elastic.co/t/problem-with-date-histogram-facet/13912 "2013-10-10T21:42:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Greg\_5](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Greg\_5](https://discuss.elastic.co/u/Greg_5)
#### Post date: [October 10, 2013, 9:42pm UTC](https://discuss.elastic.co/t/problem-with-date-histogram-facet/13912/1 "2013-10-10T21:42:36Z")

</div>

Hello,

I got a strange behaviour. My documents have a date field (unix timestamp).  
The date range is : 2013/09/01 00:00:00 to 2013/09/29.  
When i use the Date Histogram Facet with a monthly interval. I expect 1  
facet result (as all my date are in September) but i got 2 facet results.

My query is:

{  
"query": {  
"match\_all": {}  
},  
"facets": {  
"results": {  
"date\_histogram": {  
"field": "T",  
"interval": "month",  
"factor": 1000  
}  
}  
},  
"size": 0  
}

Any idea ? Thanks you!

--  
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: ![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: [October 11, 2013, 6:35am UTC](https://discuss.elastic.co/t/problem-with-date-histogram-facet/13912/2 "2013-10-11T06:35:48Z")

</div>

Hey,

what do the facet results consist of? Is the seemingly wrong one in october  
or august? Might that be a timezone issue (everything is UTC from  
elasticsearch point of view)? You can use the time\_zone parameter in a  
facet..

--Alex

On Thu, Oct 10, 2013 at 11:42 PM, Greg [gregory.bittan@gmail.com](mailto:gregory.bittan@gmail.com) wrote:

> Hello,
> 
> I got a strange behaviour. My documents have a date field (unix  
> timestamp). The date range is : 2013/09/01 00:00:00 to 2013/09/29.  
> When i use the Date Histogram Facet with a monthly interval. I expect 1  
> facet result (as all my date are in September) but i got 2 facet results.
> 
> My query is:
> 
> {  
> "query": {  
> "match\_all": {}  
> },  
> "facets": {  
> "results": {  
> "date\_histogram": {  
> "field": "T",  
> "interval": "month",  
> "factor": 1000  
> }  
> }  
> },  
> "size": 0  
> }
> 
> Any idea ? Thanks you!
> 
> --  
> 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).

--  
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:12am UTC](https://discuss.elastic.co/t/problem-with-date-histogram-facet/13912/3 "2017-07-06T02:12:55Z")

</div>


