66
77A multi-bucket aggregation that creates composite buckets from different sources.
88
9- Unlike the other `multi-bucket` aggregation the `composite` aggregation can be used
10- to paginate **all** buckets from a multi-level aggregation efficiently. This aggregation
11- provides a way to stream **all** buckets of a specific aggregation similarly to what
9+ Unlike the other `multi-bucket` aggregations, you can use the `composite`
10+ aggregation to paginate **all** buckets from a multi-level aggregation
11+ efficiently. This aggregation provides a way to stream **all** buckets of a
12+ specific aggregation, similar to what
1213<<scroll-search-results, scroll>> does for documents.
1314
1415The composite buckets are built from the combinations of the
@@ -76,7 +77,7 @@ POST /sales/_bulk?refresh
7677
7778//////////////////////////
7879
79- For instance the following document:
80+ For example, consider the following document:
8081
8182[source,js]
8283--------------------------------------------------
@@ -87,8 +88,8 @@ For instance the following document:
8788--------------------------------------------------
8889// NOTCONSOLE
8990
90- \... creates the following composite buckets when `keyword` and `number` are used as values source
91- for the aggregation :
91+ Using `keyword` and `number` as source fields for the aggregation results in
92+ the following composite buckets :
9293
9394[source,js]
9495--------------------------------------------------
@@ -101,15 +102,20 @@ for the aggregation:
101102--------------------------------------------------
102103// NOTCONSOLE
103104
104- ==== Values source
105+ ==== Value sources
105106
106- The `sources` parameter controls the sources that should be used to build the composite buckets.
107- The order that the `sources` are defined is important because it also controls the order
108- the keys are returned.
107+ The `sources` parameter defines the source fields to use when building
108+ composite buckets. The order that the `sources` are defined controls the order
109+ that the keys are returned.
109110
110- The name given to each sources must be unique .
111+ NOTE: You must use a unique name when defining `sources` .
111112
112- There are three different types of values source:
113+ The `sources` parameter can be any of the following types:
114+
115+ * <<_terms,Terms>>
116+ * <<_histogram,Histogram>>
117+ * <<_date_histogram,Date histogram>>
118+ * <<_geotile_grid,GeoTile grid>>
113119
114120[[_terms]]
115121===== Terms
@@ -430,10 +436,10 @@ GET /_search
430436}
431437--------------------------------------------------
432438
433- ===== Mixing different values source
439+ ===== Mixing different value sources
434440
435- The `sources` parameter accepts an array of values source .
436- It is possible to mix different values source to create composite buckets.
441+ The `sources` parameter accepts an array of value sources .
442+ It is possible to mix different value sources to create composite buckets.
437443For example:
438444
439445[source,console]
@@ -454,7 +460,7 @@ GET /_search
454460}
455461--------------------------------------------------
456462
457- This will create composite buckets from the values created by two values source , a `date_histogram` and a `terms`.
463+ This will create composite buckets from the values created by two value sources , a `date_histogram` and a `terms`.
458464Each bucket is composed of two values, one for each value source defined in the aggregation.
459465Any type of combinations is allowed and the order in the array is preserved
460466in the composite buckets.
@@ -542,7 +548,7 @@ first (ascending order, `asc`) or last (descending order, `desc`).
542548
543549The `size` parameter can be set to define how many composite buckets should be returned.
544550Each composite bucket is considered as a single bucket, so setting a size of 10 will return the
545- first 10 composite buckets created from the values source .
551+ first 10 composite buckets created from the value sources .
546552The response contains the values for each composite bucket in an array containing the values extracted
547553from each value source. Defaults to `10`.
548554
0 commit comments