Skip to content

Commit ce03589

Browse files
authored
[DOCS] Clarify supported rollup fields (#70045) (#70165)
1 parent bf8024b commit ce03589

File tree

1 file changed

+34
-20
lines changed

1 file changed

+34
-20
lines changed

docs/reference/rollup/apis/rollup-api.asciidoc

+34-20
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ POST /my-index-000001/_rollup/rollup-my-index-000001
5353

5454
* You can only roll up an index that contains:
5555

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`.
5860

5961
* If the {es} {security-features} are enabled, you must have the `manage`
6062
<<privileges-list-indices,index privilege>> for the index you roll up.
@@ -85,7 +87,7 @@ for the same stream.
8587
// tag::rollup-config[]
8688
`groups`::
8789
(Required, object)
88-
Aggregates and stores fields in the rollup.
90+
Aggregates and groups documents in the rollup.
8991
+
9092
.Properties of `groups`
9193
[%collapsible%open]
@@ -104,6 +106,9 @@ Groups documents based on a provided time interval.
104106
<<date,`date`>> or <<date_nanos,`date_nanos`>> field containing a timestamp. If
105107
you're rolling up a backing index or using the {ecs-ref}[Elastic Common Schema
106108
(ECS)], we recommend using `@timestamp`.
109+
+
110+
WARNING: Do not use this field in `metrics`. If you do, the rollup attempt will
111+
fail.
107112

108113
`calendar_interval` or `fixed_interval`::
109114
(Required, <<time-units,time units>>)
@@ -125,18 +130,18 @@ Defaults to `+00:00` (UTC).
125130
`histogram`::
126131
(Optional, <<search-aggregations-bucket-histogram-aggregation,`histogram`
127132
aggregation>> object)
128-
Groups and stores <<number,numeric>> field values based on a provided interval.
133+
Groups documents based on a numeric interval.
129134
+
130135
.Properties of `histogram`
131136
[%collapsible%open]
132137
======
133138
`fields`::
134139
(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.
137142
+
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.
140145

141146
`interval`::
142147
(Required*, integer)
@@ -147,36 +152,44 @@ object, this property is required.
147152
`terms`::
148153
(Optional, <<search-aggregations-bucket-terms-aggregation,`terms`
149154
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.
152156
+
153157
.Properties of `terms`
154158
[%collapsible%open]
155159
======
156160
`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.
160161
+
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+
161172
TIP: Avoid storing high-cardinality fields. High-cardinality fields can greatly
162173
increase the size of the resulting rollup index.
174+
--
163175
======
164176
=====
165177

166178
`metrics`::
167179
(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.
170182
+
171183
.Properties of `metrics` objects
172184
[%collapsible%open]
173185
=====
174186
`field`::
175187
(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.
177190
+
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.
180193
181194
`metrics`::
182195
(Required, string or array of strings)
@@ -186,8 +199,9 @@ Metrics to collect. Each value corresponds to a
186199
<<search-aggregations-metrics-max-aggregation,`max`>>,
187200
<<search-aggregations-metrics-sum-aggregation,`sum`>>,
188201
<<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.
191205
+
192206
NOTE: The rollup index stores these metrics in an
193207
<<aggregate-metric-double,`aggregate_metric_double`>> field. The `avg` metric

0 commit comments

Comments
 (0)