Skip to content

Conversation

parkertimmins
Copy link
Contributor

@parkertimmins parkertimmins commented Oct 2, 2025

Add docs for the pattern_text mapping type.

Fixes #135030

@parkertimmins parkertimmins added :StorageEngine/Mapping The storage related side of mappings v9.2.0 >docs General docs changes and removed needs:triage Requires assignment of a team area label v9.3.0 labels Oct 2, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

github-actions bot commented Oct 2, 2025

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

Comment on lines 13 to 14
* [`match_only_text`](#match-only-text-field-type), a space-optimized variant of `text` that disables scoring and performs slower on queries that need positions. It is best suited for indexing log messages.
* [`pattern_text`](#pattern-text-field-type), a variant of `text` with improved space efficiency when storing log messages.
Copy link
Contributor

Choose a reason for hiding this comment

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

This could use some clarification--which is better for log messages, match_only_text or pattern_text?

Copy link
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.

LGTM, I think someone from the docs team should also take a look at this.

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 just noticed a few things, docs wise, as I drove by, reviewing the URL preview . Let me know if anything is unclear :)

Comment on lines 12 to 14
* [`text`](#text-field-type), the traditional field type for full-text content such as the body of an email or the description of a product.
* [`match_only_text`](#match-only-text-field-type), a space-optimized variant of `text` that disables scoring and performs slower on queries that need positions. It is best suited for indexing log messages.
* [`pattern_text`](#pattern-text-field-type), a variant of `text` with improved space efficiency when storing log messages.
Copy link
Contributor

@leemthompo leemthompo Oct 6, 2025

Choose a reason for hiding this comment

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

I wonder if we should consider splitting these pages up for readability, if you're game go ahead, otherwise could create an issue to do this in a follow-up. We'd need to ensure redirects are set up in /docs/redirects.yml.

  • Text family overview
    • text field type
    • match_only_text
    • pattern_text

@leemthompo
Copy link
Contributor

leemthompo commented Oct 7, 2025

Thanks for jumping on the page splitting @parkertimmins!

I think you need something like the following redirect pattern in https://github.com/elastic/elasticsearch/blob/main/docs/redirects.yml to fix the error:

'reference/elasticsearch/mapping-reference/text.md':
  anchors:
    'match-only-text-field-type': 'reference/elasticsearch/mapping-reference/match-only-text.md#match-only-text-field-type'
    'match-only-text-params': 'reference/elasticsearch/mapping-reference/match-only-text.md#match-only-text-params'

Beware the syntax can be kinda finicky :)

Note: You need these because the link failures are X-links from the docs-content repo


* [`text`](/reference/elasticsearch/mapping-reference/text.md), the traditional field type for full-text content such as the body of an email or the description of a product.
* [`match_only_text`](/reference/elasticsearch/mapping-reference/match-only-text.md), a space-optimized variant of `text` that disables scoring and performs slower on queries that need positions. It is best suited for indexing log messages.
* [`pattern_text`](/reference/elasticsearch/mapping-reference/pattern-text.md), a variant of `text` which is optimized for log messages which contain sequences that are shared between many messages. By compressing these shared sequences, `pattern_text` provides improved space efficiency relative to `match_only_text`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jordan-powers and @martijnvg What do ya'll think of this blurb? I'm having trouble coming up with a description that is succinct and described the difference between pattern_text and match_only_text.

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.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docs for pattern_text
5 participants