# Grouping by non-numeric field

**URL:** <https://discuss.elastic.co/t/grouping-by-non-numeric-field/4116>\
**Category:** Elasticsearch\
**Created:** [March 16, 2011, 7:59pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-field/4116 "2011-03-16T19:59:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jason](https://discuss.elastic.co/u/jason)\
**Post date:** [March 16, 2011, 7:59pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-field/4116/1 "2011-03-16T19:59:36Z")

</div>

Shay,

For some reason I am not able to post any messages on elasticsearch  
group. Could you please post the message below?  
Thank you!

Eugene.

Hi,

I would like to write a query in ES that shows counts for each  
person's name, equivalent to the following SQL query:

select name, count() from people group by name;

I found a similar request here: [https://github.com/elasticsearch/elasticsearch/issues/#issue/539](https://github.com/elasticsearch/elasticsearch/issues/#issue/539)

Does this feature already exist in the most recent version of ES? If  
yes, which facet should I use? I looked at terms and histogram facets,  
and they don't seem to be appropriate.

If anyone has implemented this before, please share your knowledge.

Thank you,  
Eugene.

---

<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:** [March 16, 2011, 8:00pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-field/4116/2 "2011-03-16T20:00:15Z")

</div>

You are spamming, you now send me mails several times?  
On Wednesday, March 16, 2011 at 9:59 PM, eugene wrote:

> Shay,
> 
> For some reason I am not able to post any messages on elasticsearch  
> group. Could you please post the message below?  
> Thank you!
> 
> Eugene.
> 
> Hi,
> 
> I would like to write a query in ES that shows counts for each  
> person's name, equivalent to the following SQL query:
> 
> select name, count() from people group by name;
> 
> I found a similar request here: [Issues · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/#issue/539)
> 
> Does this feature already exist in the most recent version of ES? If  
> yes, which facet should I use? I looked at terms and histogram facets,  
> and they don't seem to be appropriate.
> 
> If anyone has implemented this before, please share your knowledge.
> 
> Thank you,  
> Eugene.

---

<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:09am UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-field/4116/3 "2017-07-06T04:09:51Z")

</div>


