mapping-settings-limit.asciidoc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. [[mapping-settings-limit]]
  2. == Mapping limit settings
  3. Use the following settings to limit the number of field mappings (created manually or dynamically) and prevent documents from causing a mapping explosion:
  4. `index.mapping.total_fields.limit`::
  5. The maximum number of fields in an index. Field and object mappings, as well as
  6. field aliases count towards this limit. The default value is `1000`.
  7. +
  8. [IMPORTANT]
  9. ====
  10. The limit is in place to prevent mappings and searches from becoming too
  11. large. Higher values can lead to performance degradations and memory issues,
  12. especially in clusters with a high load or few resources.
  13. If you increase this setting, we recommend you also increase the
  14. <<search-settings,`indices.query.bool.max_clause_count`>> setting, which
  15. limits the maximum number of <<query-dsl-bool-query,boolean clauses>> in a query.
  16. ====
  17. +
  18. [TIP]
  19. ====
  20. If your field mappings contain a large, arbitrary set of keys, consider using the <<flattened,flattened>> data type.
  21. ====
  22. `index.mapping.depth.limit`::
  23. The maximum depth for a field, which is measured as the number of inner
  24. objects. For instance, if all fields are defined at the root object level,
  25. then the depth is `1`. If there is one object mapping, then the depth is
  26. `2`, etc. Default is `20`.
  27. // tag::nested-fields-limit[]
  28. `index.mapping.nested_fields.limit`::
  29. The maximum number of distinct `nested` mappings in an index. The `nested` type should only be used in special cases, when arrays of objects need to be queried independently of each other. To safeguard against poorly designed mappings, this setting
  30. limits the number of unique `nested` types per index. Default is `50`.
  31. // end::nested-fields-limit[]
  32. // tag::nested-objects-limit[]
  33. `index.mapping.nested_objects.limit`::
  34. The maximum number of nested JSON objects that a single document can contain across all
  35. `nested` types. This limit helps to prevent out of memory errors when a document contains too many nested
  36. objects. Default is `10000`.
  37. // end::nested-objects-limit[]
  38. `index.mapping.field_name_length.limit`::
  39. Setting for the maximum length of a field name. This setting isn't really something that addresses
  40. mappings explosion but might still be useful if you want to limit the field length.
  41. It usually shouldn't be necessary to set this setting. The default is okay
  42. unless a user starts to add a huge number of fields with really long names. Default is
  43. `Long.MAX_VALUE` (no limit).