terms

fun terms(field: String, alias: String, missingKey: String? = null, scope: AggregationGroupScope? = null)

scope ROOT groups the expanded elements by a field of their root record (AggregationGroup.scope).