Alphabetically sorting + aggregation ElasticSearch

Could you share a script with dummy data that we can just paste in Kibana dev console and then click on the play button to execute it?