# Grouping by non-numeric fields

**URL:** <https://discuss.elastic.co/t/grouping-by-non-numeric-fields/4113>\
**Category:** Elasticsearch\
**Created:** [March 16, 2011, 6:44pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-fields/4113 "2011-03-16T18:44:23Z")\
**Posts on this page:** 2\
**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, 6:44pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-fields/4113/1 "2011-03-16T18:44:23Z")

</div>

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:** ![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-fields/4113/2 "2017-07-06T04:09:54Z")

</div>


