How to make terms aggregation case insensitive?

I have a field called user_name. Examples of entries are "user", "User" and "someuser". When I aggrrgate by terms, the result treats "user" and "User" as 2 different results. Rightly so, for obvious reasons. However, is there a way for Elasticsearch to treat them as the same? Even if the entry would be "user", "User", "uSeR" or "UsEr", aggregations would fall to the same bucket "USER". Thanks in advance.

See https://www.elastic.co/guide/en/elasticsearch/reference/master/normalizer.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.