# Multiple date histogram on a single call

**URL:** <https://discuss.elastic.co/t/multiple-date-histogram-on-a-single-call/11431>\
**Category:** Elasticsearch\
**Created:** [April 3, 2013, 2:23pm UTC](https://discuss.elastic.co/t/multiple-date-histogram-on-a-single-call/11431 "2013-04-03T14:23:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 3, 2013, 2:23pm UTC](https://discuss.elastic.co/t/multiple-date-histogram-on-a-single-call/11431/1 "2013-04-03T14:23:05Z")

</div>

Hi ,

For the same result query , i want to create multiple date histograms based  
on values of a field.  
Lets say i have a field called Type. Its value can be AA,BB,CC.  
Now for any query i want to create a graph based on value AA and BB and CC.  
So instead of firing 3 queries with different values of Type , is it  
possible to get date histogram for each value of Type.

Thanks  
Vineeth

--  
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:** [April 4, 2013, 6:45am UTC](https://discuss.elastic.co/t/multiple-date-histogram-on-a-single-call/11431/2 "2013-04-04T06:45:39Z")

</div>

Hey,

not really sure if I got your question right, but querying for multiple  
date histogram values is not a problem.

curl -X PUT localhost:9200/test/test/1 '{ "date1":"2010/01/01", "date2" :  
"2011/01/01" }'  
curl -X POST localhost:9200/test/test/\_search -d '{ "query" : {  
"match\_all": { } }, "facets" : { "date1" : { "date\_histogram" : {  
"field":"date1", "interval":"1d" } }, "date2" : { "date\_histogram" : {  
"field":"date2", "interval":"1d" } } } } '

This facets on both date fields. However I am not sure if you meant that  
with AA, BB and CC.

On Wed, Apr 3, 2013 at 4:23 PM, Vineeth Mohan [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)wrote:

> Hi ,
> 
> For the same result query , i want to create multiple date histograms  
> based on values of a field.  
> Lets say i have a field called Type. Its value can be AA,BB,CC.  
> Now for any query i want to create a graph based on value AA and BB and CC.  
> So instead of firing 3 queries with different values of Type , is it  
> possible to get date histogram for each value of Type.
> 
> Thanks  
> Vineeth
> 
> --  
> 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:42am UTC](https://discuss.elastic.co/t/multiple-date-histogram-on-a-single-call/11431/3 "2017-07-06T02:42:51Z")

</div>


