@@ -53,8 +53,10 @@ POST /my-index-000001/_rollup/rollup-my-index-000001
53
53
54
54
* You can only roll up an index that contains:
55
55
56
- ** A <<date,`date`>> or <<date_nanos,`date_nanos`>> timestamp field
57
- ** One or more <<number,numeric>> fields
56
+ ** A <<date,`date`>> or <<date_nanos,`date_nanos`>> timestamp field.
57
+ ** At least one metric to roll up. This field must be a <<number,numeric>>,
58
+ `date`, or `date_nanos` field other than the timestamp field. This field
59
+ cannot be an `unsigned_long`.
58
60
59
61
* If the {es} {security-features} are enabled, you must have the `manage`
60
62
<<privileges-list-indices,index privilege>> for the index you roll up.
@@ -85,7 +87,7 @@ for the same stream.
85
87
// tag::rollup-config[]
86
88
`groups`::
87
89
(Required, object)
88
- Aggregates and stores fields in the rollup.
90
+ Aggregates and groups documents in the rollup.
89
91
+
90
92
.Properties of `groups`
91
93
[%collapsible%open]
@@ -104,6 +106,9 @@ Groups documents based on a provided time interval.
104
106
<<date,`date`>> or <<date_nanos,`date_nanos`>> field containing a timestamp. If
105
107
you're rolling up a backing index or using the {ecs-ref}[Elastic Common Schema
106
108
(ECS)], we recommend using `@timestamp`.
109
+ +
110
+ WARNING: Do not use this field in `metrics`. If you do, the rollup attempt will
111
+ fail.
107
112
108
113
`calendar_interval` or `fixed_interval`::
109
114
(Required, <<time-units,time units>>)
@@ -125,18 +130,18 @@ Defaults to `+00:00` (UTC).
125
130
`histogram`::
126
131
(Optional, <<search-aggregations-bucket-histogram-aggregation,`histogram`
127
132
aggregation>> object)
128
- Groups and stores <<number,numeric>> field values based on a provided interval.
133
+ Groups documents based on a numeric interval.
129
134
+
130
135
.Properties of `histogram`
131
136
[%collapsible%open]
132
137
======
133
138
`fields`::
134
139
(Required*, string or array of strings)
135
- <<number,Numeric>> fields to group. If you specify a `histogram` object, this
136
- property is required.
140
+ <<number,Numeric>> fields to group. `unsigned_long` fields are not supported. If
141
+ you specify a `histogram` object, this property is required.
137
142
+
138
- WARNING: Do not use the same fields in `histogram` and ` metrics`. If you specify
139
- the same field in both `histogram` and `metrics`, the rollup attempt will fail.
143
+ WARNING: Do not use these fields in `metrics`. If you do, the rollup attempt
144
+ will fail.
140
145
141
146
`interval`::
142
147
(Required*, integer)
@@ -147,36 +152,44 @@ object, this property is required.
147
152
`terms`::
148
153
(Optional, <<search-aggregations-bucket-terms-aggregation,`terms`
149
154
aggregation>> object)
150
- Groups and stores unique values for <<keyword,keyword family>> and
151
- <<number,numeric>> fields.
155
+ Groups documents based on unique field values.
152
156
+
153
157
.Properties of `terms`
154
158
[%collapsible%open]
155
159
======
156
160
`fields`::
157
- (Required*, string or array of strings)
158
- <<keyword,Keyword family>> and <<number,numeric>> fields to store. If you
159
- specify a `terms` object, this property is required.
160
161
+
162
+ --
163
+ (Required*, string or array of strings)
164
+ Fields to store unique values for. Supports the following field types:
165
+
166
+ * <<keyword,Keyword family>> types
167
+ * <<number,Numeric>> types, excluding `unsigned_long`
168
+ * <<text,`text`>> fields with <<fielddata-mapping-param,`fielddata`>> enabled
169
+
170
+ If you specify a `terms` object, this property is required.
171
+
161
172
TIP: Avoid storing high-cardinality fields. High-cardinality fields can greatly
162
173
increase the size of the resulting rollup index.
174
+ --
163
175
======
164
176
=====
165
177
166
178
`metrics`::
167
179
(Required, object or array of objects)
168
- Collects and stores metrics for <<number,numeric>> fields. You must specify at
169
- least one `metrics` object.
180
+ Collects and stores metrics for fields. You must specify at least one `metrics`
181
+ object.
170
182
+
171
183
.Properties of `metrics` objects
172
184
[%collapsible%open]
173
185
=====
174
186
`field`::
175
187
(Required, string)
176
- <<number,Numeric>> field to collect metrics for.
188
+ <<number,Numeric>>, <<date,`date`>>, or <<date_nanos,`date_nanos`>> field to
189
+ collect metrics for. `unsigned_long` fields are not supported.
177
190
+
178
- WARNING: Do not use the same fields in `histogram` and `metrics `. If you specify
179
- the same field in both `histogram` and `metrics` , the rollup attempt will fail.
191
+ WARNING: Do not use fields specified in `histogram` or `date_histogram `. If you
192
+ do , the rollup attempt will fail.
180
193
181
194
`metrics`::
182
195
(Required, string or array of strings)
@@ -186,8 +199,9 @@ Metrics to collect. Each value corresponds to a
186
199
<<search-aggregations-metrics-max-aggregation,`max`>>,
187
200
<<search-aggregations-metrics-sum-aggregation,`sum`>>,
188
201
<<search-aggregations-metrics-avg-aggregation,`avg`>>, and
189
- <<search-aggregations-metrics-valuecount-aggregation,`value_count`>>. You must
190
- specify at least one value.
202
+ <<search-aggregations-metrics-valuecount-aggregation,`value_count`>>. <<date,`date`>> and <<date_nanos,`date_nanos`>>
203
+ fields only support the `max`, `min`, and `value_count` metrics. You must specify
204
+ at least one value.
191
205
+
192
206
NOTE: The rollup index stores these metrics in an
193
207
<<aggregate-metric-double,`aggregate_metric_double`>> field. The `avg` metric
0 commit comments