# Group By Counts

**URL:** https://discuss.elastic.co/t/group-by-counts/3233
**Category:** Elasticsearch
**Created:** [August 19, 2010, 1:04am UTC](https://discuss.elastic.co/t/group-by-counts/3233 "2010-08-19T01:04:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Gustavo\_Arjones\_2](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Gustavo\_Arjones\_2](https://discuss.elastic.co/u/Gustavo_Arjones_2)
#### Post date: [August 19, 2010, 1:04am UTC](https://discuss.elastic.co/t/group-by-counts/3233/1 "2010-08-19T01:04:47Z")

</div>

Hi,

I'm evaluating replace MySQL+Fulltext search for ES.

Currently I fetch information from twitter, using twitter stream api  
and save it to mysql, of course, this solution isnt scalable ...

ES seems to be solution for my needs, there is one point I couln't  
figure out: it is how to get count() on a date range grouped by date -  
I use this kind of information to show some trends.

My query is something like:

Select created\_at, count()  
From summary  
where create\_at between '2010-01-01' and '2010-01-31'  
and  
match(text) against ('java OR ruby' in boolean match)  
Group by create\_at;

What should be the best way to replicate this behavior?

Thanks a lot!  
Gustavo Arjones

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [August 19, 2010, 7:10am UTC](https://discuss.elastic.co/t/group-by-counts/3233/2 "2010-08-19T07:10:58Z")

</div>

Check out the facets support elasticsearch (the histogram facet), in  
upcoming 0.9.1 there will also be a range facet that supports dates.

-shay.banon

On Thu, Aug 19, 2010 at 4:04 AM, Gustavo Arjones  
[gustavo.arjones@gmail.com](mailto:gustavo.arjones@gmail.com)wrote:

> Hi,
> 
> I'm evaluating replace MySQL+Fulltext search for ES.
> 
> Currently I fetch information from twitter, using twitter stream api  
> and save it to mysql, of course, this solution isnt scalable ...
> 
> ES seems to be solution for my needs, there is one point I couln't  
> figure out: it is how to get count() on a date range grouped by date -  
> I use this kind of information to show some trends.
> 
> My query is something like:
> 
> Select created\_at, count()  
> From summary  
> where create\_at between '2010-01-01' and '2010-01-31'  
> and  
> match(text) against ('java OR ruby' in boolean match)  
> Group by create\_at;
> 
> What should be the best way to replicate this behavior?
> 
> Thanks a lot!  
> Gustavo Arjones

---

<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, 4:20am UTC](https://discuss.elastic.co/t/group-by-counts/3233/3 "2017-07-06T04:20:36Z")

</div>


