You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Matrix Aggregationsedit

This functionality is experimental and may be changed or removed completely in a future release.
The aggregations in this family operate on multiple fields and produce a matrix result based on the values extracted from the requested document fields. Unlike metric and bucket aggregations, this aggregation family does not yet support scripting.