# Grouping by non-numeric fields

**URL:** <https://discuss.elastic.co/t/grouping-by-non-numeric-fields/4112>\
**Category:** Elasticsearch\
**Created:** [March 16, 2011, 6:29pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-fields/4112 "2011-03-16T18:29:24Z")\
**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:29pm UTC](https://discuss.elastic.co/t/grouping-by-non-numeric-fields/4112/1 "2011-03-16T18:29:24Z")

</div>

Hi,

I found similar topics on this board how to create an equivalent  
query to "select field\_name, count() from tableName group by  
field\_name" when the field is numeric or date. However, I couldn't  
find any proper facets when the field is a string. For example, I  
want to display all names and how many times each name repeats in the  
table.  
It seems that histogram facet is not applicable here, and neither is  
terms facet. If anyone knows how to implement this query in ES,  
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/4112/2 "2017-07-06T04:09:55Z")

</div>


