diff --git a/docs/reference/mapping.asciidoc b/docs/reference/mapping.asciidoc index 5507ba97ff6..dffb4f94ff5 100644 --- a/docs/reference/mapping.asciidoc +++ b/docs/reference/mapping.asciidoc @@ -64,6 +64,29 @@ the <>, the This is the purpose of _multi-fields_. Most datatypes support multi-fields via the <> parameter. +[[mapping-limit-settings]] +[float] +=== Settings to prevent mappings explosion + +The following settings allow you to limit the number of field mappings that +can be created manually or dynamically, in order to prevent bad documents from +causing a mapping explosion: + +`index.mapping.total_fields.limit`:: + The maximum number of fields in an index. The default value is `1000`. + +`index.mapping.depth.limit`:: + The maximum depth for a field, which is measured as the number of inner + objects. For instance, if all fields are defined at the root object level, + then the depth is `1`. If there is one object mapping, then the depth is + `2`, etc. The default is `20`. + +`index.mapping.nested_fields.limit`:: + The maximum number of `nested` fields in an index, defaults to `50`. + Indexing 1 document with 100 nested fields actually indexes 101 documents + as each nested document is indexed as a separate hidden document. + + [float] == Dynamic mapping diff --git a/docs/reference/mapping/dynamic/field-mapping.asciidoc b/docs/reference/mapping/dynamic/field-mapping.asciidoc index 020c5d24552..7bed12b5b78 100644 --- a/docs/reference/mapping/dynamic/field-mapping.asciidoc +++ b/docs/reference/mapping/dynamic/field-mapping.asciidoc @@ -30,20 +30,6 @@ detected. All other datatypes must be mapped explicitly. Besides the options listed below, dynamic field mapping rules can be further customised with <>. -[[mapping-limit-settings]] -==== Settings to prevent mappings explosion - -Two settings allow to control mapping explosion, in order to prevent adversary -documents to create huge mappings through dynamic mappings for instance: - -`index.mapping.total_fields.limit`:: - The maximum number of fields in an index. The default value is `1000`. -`index.mapping.depth.limit`:: - The maximum depth for a field, which is measured as the number of nested - objects. For instance, if all fields are defined at the root object level, - then the depth is `1`. If there is one object mapping, then the depth is - `2`, etc. The default is `20`. - [[date-detection]] ==== Date detection diff --git a/docs/reference/mapping/types/nested.asciidoc b/docs/reference/mapping/types/nested.asciidoc index 8850763cdc8..91bbf98c921 100644 --- a/docs/reference/mapping/types/nested.asciidoc +++ b/docs/reference/mapping/types/nested.asciidoc @@ -205,5 +205,5 @@ phase. Instead, highlighting needs to be performed via Indexing a document with 100 nested fields actually indexes 101 documents as each nested document is indexed as a separate document. To safeguard against ill-defined mappings -the number of nested fields that can be defined per index has been limited to 50. This -default limit can be changed with the index setting `index.mapping.nested_fields.limit`. +the number of nested fields that can be defined per index has been limited to 50. See +<>.