Distinct result in elasticsearch

Hi
I want to get the list of all the user's email from the elasticsearch.
Like in mongo engine we can query
user_emails = User.objects().distinct("user_email")
This results in list like this = ['email1@email.com', 'email2@email.com']

I want to achieve this using elasticsearch. I am using elasticsearch 6.3. Does anyone have any thoughts about this?

A Terms aggregation will give you the most frequent emails.

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