Grouping by non-numeric fields


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:

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,