Grouping by non-numeric fields


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
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,