For accessing full documents you can to use a scripted_metric aggregation, the ootb aggregations work on single fields, not documents.
Top hits/metric won't help you, as you still need to collapse the entries into a document.
My advent calendar post from 2019 does collapsing the way you describe it, it is written in german, but maybe you can use in-built browser translation or a web service to translate it:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.