Skip to content

Commit

Permalink
[DOCS] Document time_series_metric mapping parameter (#78013)
Browse files Browse the repository at this point in the history
Changes:
* Documents the `time_series_metric` mapping parameter for PR #76766.
* Renames the `dimension` parameter to `time_series_dimension` for PR #78012.
* Adds support for `unsigned_long` to `time_series_dimension` for PR #78204.
  • Loading branch information
jrodewig authored Sep 23, 2021
1 parent 339d9f0 commit ce4b95e
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 36 deletions.
3 changes: 2 additions & 1 deletion docs/reference/index-modules.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ pipeline attempts to change the `_index` field, the indexing request will fail.
For internal use by Elastic only. Maximum number of time series dimensions for
the index. Defaults to `16`.
+
You can mark a field as a dimension using the `dimension` mapping parameter.
You can mark a field as a dimension using the `time_series_dimension` mapping
parameter.

[[index-hidden]] `index.hidden`::

Expand Down
5 changes: 5 additions & 0 deletions docs/reference/mapping/types/aggregate-metric-double.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ specify at least one value.
Default metric sub-field to use for queries, scripts, and aggregations that
don't use a sub-field. Must be a value from the `metrics` array.

include::numeric.asciidoc[tag=time_series_metric]
+
For `aggregate_metric_double` fields, this parameter accepts `counter`, `gauge`,
and `summary`. You can't update this parameter for existing fields.

[[aggregate-metric-double-uses]]
==== Uses

Expand Down
8 changes: 8 additions & 0 deletions docs/reference/mapping/types/histogram.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ per document. Nested arrays are not supported.
* `histogram` fields do not support sorting.
========

[[histogram-params]]
==== Parameters

include::numeric.asciidoc[tag=time_series_metric]
+
For `histogram` fields, this parameter accepts `histogram`. You can't update
this parameter for existing fields.

[[histogram-uses]]
==== Uses

Expand Down
6 changes: 2 additions & 4 deletions docs/reference/mapping/types/ip.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ NOTE: You can also store ip ranges in a single field using an <<range,ip_range d

The following parameters are accepted by `ip` fields:

[horizontal]

include::keyword.asciidoc[tag=dimension]

<<doc-values,`doc_values`>>::

Should the field be stored on disk in a column-stride fashion, so that it
Expand Down Expand Up @@ -95,6 +91,8 @@ include::keyword.asciidoc[tag=dimension]
the <<mapping-source-field,`_source`>> field. Accepts `true` or `false`
(default).

include::keyword.asciidoc[tag=dimension]

[[query-ip-fields]]
==== Querying `ip` fields

Expand Down
40 changes: 19 additions & 21 deletions docs/reference/mapping/types/keyword.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,6 @@ include::numeric.asciidoc[tag=map-ids-as-keyword]

The following parameters are accepted by `keyword` fields:

[horizontal]

// tag::dimension[]
`dimension`::
For internal use by Elastic only. Marks the field as a time series dimension.
Accepts `true` or `false` (default).
+
The <<index-mapping-dimension-fields-limit,`index.mapping.dimension_fields.limit`>>
index setting limits the number of dimensions in an index.
+
Dimension fields have the following constraints:
+
* The `doc_values` and `index` mapping parameters must be `true`.
* Field values cannot be an <<array,array or multi-value>>.
// end::dimension[]
* Field values cannot be larger than 1024 bytes.
* The field cannot use a <<normalizer,`normalizer`>>.

<<doc-values,`doc_values`>>::

Should the field be stored on disk in a column-stride fashion, so that it
Expand Down Expand Up @@ -107,6 +89,10 @@ Dimension fields have the following constraints:
Defaults to `docs` but can also be set to `freqs` to take term frequency into account
when computing scores.

<<mapping-field-meta,`meta`>>::

Metadata about the field.

<<norms,`norms`>>::

Whether field-length should be taken into account when scoring queries.
Expand Down Expand Up @@ -161,9 +147,21 @@ Dimension fields have the following constraints:
when building a query for this field.
Accepts `true` or `false` (default).

<<mapping-field-meta,`meta`>>::

Metadata about the field.
// tag::dimension[]
`time_series_dimension`::
(Optional, Boolean) For internal use by Elastic only. Marks the field as a time
series dimension. Defaults to `false`.
+
The <<index-mapping-dimension-fields-limit,`index.mapping.dimension_fields.limit`>>
index setting limits the number of dimensions in an index.
+
Dimension fields have the following constraints:
+
* The `doc_values` and `index` mapping parameters must be `true`.
* Field values cannot be an <<array,array or multi-value>>.
// end::dimension[]
* Field values cannot be larger than 1024 bytes.
* The field cannot use a <<normalizer,`normalizer`>>.

include::constant-keyword.asciidoc[]

Expand Down
33 changes: 23 additions & 10 deletions docs/reference/mapping/types/numeric.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,12 @@ the data as both a `keyword` _and_ a numeric data type.

The following parameters are accepted by numeric types:

[horizontal]

<<coerce,`coerce`>>::

Try to convert strings to numbers and truncate fractions for integers.
Accepts `true` (default) and `false`. Not applicable for `unsigned_long`.
Note that this cannot be set if the `script` parameter is used.

include::keyword.asciidoc[tag=dimension]
+
Of the numeric field types, only `byte`, `short`, `integer`, and `long` fields
support this parameter.

<<doc-values,`doc_values`>>::

Should the field be stored on disk in a column-stride fashion, so that it
Expand All @@ -140,6 +133,10 @@ support this parameter.

Should the field be searchable? Accepts `true` (default) and `false`.

<<mapping-field-meta,`meta`>>::

Metadata about the field.

<<null-value,`null_value`>>::

Accepts a numeric value of the same `type` as the field which is
Expand Down Expand Up @@ -173,9 +170,25 @@ support this parameter.
the <<mapping-source-field,`_source`>> field. Accepts `true` or `false`
(default).

<<mapping-field-meta,`meta`>>::

Metadata about the field.
include::keyword.asciidoc[tag=dimension]
+
Of the numeric field types, only `byte`, `short`, `integer`, `long`, and
`unsigned_long` fields support this parameter.
+
A numeric field can't be both a time series dimension and a time series metric.

// tag::time_series_metric[]
`time_series_metric`::
(Optional, string) For internal use by Elastic only. Marks the field as a time
series metric. The value is the metric type. Defaults to `null` (Not a time
series metric).
// end::time_series_metric[]
+
For numeric fields, this parameter accepts `gauge` and `counter`. You can't
update this parameter for existing fields.
+
For a numeric time series metric, the `doc_values` parameter must be `true`. A
numeric field can't be both a time series dimension and a time series metric.

[[scaled-float-params]]
==== Parameters for `scaled_float`
Expand Down

0 comments on commit ce4b95e

Please sign in to comment.