Issue
I have an Elasticsearch database query and I want to generate a list of unique values for a specific field. I tried using the "collapse" method but couldn't get it to work. I want to work with the existing results on the client-side and not re-run the query on the server.
Resolution
This article on how to get distinct values from a field in ElasticSearch helps solve the issue.