Skip to content

Conversation

@not-napoleon
Copy link
Member

This adds documentation for the new t-digest field type.

@not-napoleon not-napoleon added >docs General docs changes auto-backport Automatically create backport pull requests when merged :StorageEngine/Mapping The storage related side of mappings v9.3.0 v9.4.0 labels Jan 9, 2026
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

ℹ️ 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?

 Conflicts:
	docs/reference/query-languages/esql/limitations.md
In general, the higher this number, the more space on disk the field will use
but the more accurate the sketch approximations will be. Default is `100`
* `digest_type`, which selects the merge strategy to use with the sketch. Valid
values are `hybrid`, `avl_tree`, and `merging`. The default is `hybrid`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I missed this, we shouldn't expose such details. I'd say we hide it entirely, and maybe add something like [execution_hint: high_accuracy] if there's an ask for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created #140736 to address this. For now, I'll just pull this bit out of the docs so we can merge it, and I'll update them when I change the parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is addressed in this PR.

indexed.

`tdigest` fields are supported in ES|QL; see the
[ES|QL reference](/reference/query-languages/esql.md) for details.
Copy link
Contributor

@kkrik-es kkrik-es Jan 13, 2026

Choose a reason for hiding this comment

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

Maybe add a note here about notable aggregation functions, i.e. percentile, min, max, sum and count.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

}
```

Indexing a minimal document
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add newline after this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@kkrik-es kkrik-es requested a review from marciw January 13, 2026 06:52
@marciw marciw requested review from a team and removed request for marciw January 13, 2026 15:00
Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

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

I left a few wording and structural suggestions, along with a few nits :)

Let me know if anything is unclear, I'll defer to @kkrik-es for the final approval, because this smells a lot more like math than I'm comfortable with 😉

[sorry some of the comments are out of order, so the changes aren't 100% linear]

will compute them based on the given `centroids` and `counts`, with some loss of
accuracy.

::::{important}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd move this to ## Limitations subheading instead of an admonition like this

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do that if you want, but I'm just copying how it is in the Exponential Histogram Field Docs

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's easier to scan and find if we use a subheading, but it's not a huge deal :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe update both pages?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, updated both.

not-napoleon and others added 5 commits January 20, 2026 11:11
@not-napoleon not-napoleon removed the >docs General docs changes label Jan 20, 2026
@elasticsearchmachine elasticsearchmachine removed the Team:Docs Meta label for docs team label Jan 20, 2026
@elasticsearchmachine
Copy link
Collaborator

Hi @not-napoleon, I've created a changelog YAML for you.

@not-napoleon
Copy link
Member Author

I folded the change for the digest type parameter into this PR, and marked it as an enhancement as result.

In general, the higher this number, the more space on disk the field will use
but the more accurate the sketch approximations will be. Default is `100`
* `digest_type`, which selects the merge strategy to use with the sketch. Valid
values are `default` and `high_accuracy`. The default is `default`.
Copy link
Contributor

@kkrik-es kkrik-es Jan 21, 2026

Choose a reason for hiding this comment

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

Maybe explain that the high_accuracy one is slower and allocates more memory? While the default is optimized for merging speed and constant memory footprint.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@not-napoleon not-napoleon requested a review from kkrik-es January 26, 2026 20:05
@not-napoleon not-napoleon merged commit 0f8e5d8 into elastic:main Jan 27, 2026
35 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.3 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 140478

not-napoleon added a commit to not-napoleon/elasticsearch that referenced this pull request Jan 27, 2026
Adds documentation for the T-Digest field type, and makes a small change to the Exponential Histogram field type docs for consistency.

While working on this, we decided the initial way of specifying the digest type for the t-digest field was overly complex, and moved to a simpler set of choices.  That code change is also included in this mostly docs update.
---------

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>

 Conflicts:
	docs/reference/elasticsearch/mapping-reference/exponential-histogram.md
	docs/reference/elasticsearch/toc.yml
	docs/reference/query-languages/esql/limitations.md
elasticsearchmachine pushed a commit that referenced this pull request Jan 27, 2026
Adds documentation for the T-Digest field type, and makes a small change to the Exponential Histogram field type docs for consistency.

While working on this, we decided the initial way of specifying the digest type for the t-digest field was overly complex, and moved to a simpler set of choices.  That code change is also included in this mostly docs update.
---------

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>

 Conflicts:
	docs/reference/elasticsearch/mapping-reference/exponential-histogram.md
	docs/reference/elasticsearch/toc.yml
	docs/reference/query-languages/esql/limitations.md
schase-es pushed a commit to schase-es/elasticsearch that referenced this pull request Jan 28, 2026
Adds documentation for the T-Digest field type, and makes a small change to the Exponential Histogram field type docs for consistency.

While working on this, we decided the initial way of specifying the digest type for the t-digest field was overly complex, and moved to a simpler set of choices.  That code change is also included in this mostly docs update.
---------

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending >enhancement :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants