Skip to content

docs: explain how fields are counted towards total_fields.limit#139915

Merged
salvatore-campagna merged 9 commits intoelastic:mainfrom
salvatore-campagna:docs/field-couning-docs-update
Dec 23, 2025
Merged

docs: explain how fields are counted towards total_fields.limit#139915
salvatore-campagna merged 9 commits intoelastic:mainfrom
salvatore-campagna:docs/field-couning-docs-update

Conversation

@salvatore-campagna
Copy link
Copy Markdown
Contributor

Adds documentation explaining how Elasticsearch counts fields towards the index.mapping.total_fields.limit setting.

This addresses a common source of confusion where users count only leaf fields (fields with a type property) but miss object mappers (which have properties instead). For deeply nested field paths like those in ECS-style mappings, this can cause users to significantly underestimate their actual mapper count.

Documentation changes:

  • Explain what counts towards the limit (object mappers, field mappers, multi-fields, aliases, runtime fields)
  • Clarify that metadata fields do not count
  • Add examples showing how nested paths like host.os.name create 3 mappers, not 1
  • Document how subobjects: false reduces field count

Moreover, add FieldCountingTests.java to validate the documented counting behavior.

Add documentation explaining that total_fields.limit counts all mappers
(object mappers, field mappers, multi-fields, aliases, runtime fields),
not just leaf fields. Include examples and note that subobjects: false
reduces the count by avoiding intermediate object mappers.

Add FieldCountingTests.java to document and capture the documented behavior.
@salvatore-campagna salvatore-campagna self-assigned this Dec 22, 2025
@salvatore-campagna salvatore-campagna added >docs General docs changes :StorageEngine/Mapping The storage related side of mappings labels Dec 22, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/core-docs (Team:Docs)

@shainaraskas
Copy link
Copy Markdown
Contributor

hi @salvatore-campagna - I think you might need to update your branch to get the docs CI to pass. sorry for the inconvenience!

@salvatore-campagna salvatore-campagna changed the title docs: explain how fields are counted towards total_fields.limit docs: explain how fields are counted towards total_fields.limit Dec 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 22, 2025

🔍 Preview links for changed docs

@github-actions
Copy link
Copy Markdown
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

Copy link
Copy Markdown
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Salvatore! LGTM

@salvatore-campagna salvatore-campagna merged commit e870486 into elastic:main Dec 23, 2025
35 checks passed
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Dec 29, 2025
…astic#139915)

Add documentation explaining that total_fields.limit counts all mappers
(object mappers, field mappers, multi-fields, aliases, runtime fields),
not just leaf fields. Include examples and note that subobjects: false
reduces the count by avoiding intermediate object mappers.

Add FieldCountingTests.java to document and capture the documented behavior.

The subobjects mapping parameter was introduced in Elasticsearch 8.3.0 (PR elastic#86166).
Adding the `applies_to` tag ensures readers know this feature is version-specific,
following cumulative docs guidelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs General docs changes :StorageEngine/Mapping The storage related side of mappings Team:Docs Meta label for docs team Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants