Skip to content

[8.19] Synthetic source: avoid storing multi fields of type text and match_only_text by default #129251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

martijnvg
Copy link
Member

Backporting #129126 to 8.19 branch.

Don't store text and match_only_text field by default when source mode is synthetic and a field is a multi field or when there is a suitable multi field.

Without this change, ES would store field otherwise twice in a multi-field configuration.

For example:

...
"os": {
  "properties": {
    "name": {
      "ignore_above": 1024,
      "type": "keyword",
      "fields": {
        "text": {
          "type": "match_only_text"
        }
      }
    }
...

In this case, two stored fields were added, one in case for the name field and one for name.text multi-field. This change prevents this, and would never store a stored field when text or match_only_text field is a multi-field.

…match_only_text by default

Backporting elastic#129126 to 8.19 branch.

Don't store text and match_only_text field by default when source mode is synthetic and a field is a multi field or when there is a suitable multi field.

Without this change, ES would store field otherwise twice in a multi-field configuration.

For example:

```
...
"os": {
  "properties": {
    "name": {
      "ignore_above": 1024,
      "type": "keyword",
      "fields": {
        "text": {
          "type": "match_only_text"
        }
      }
    }
...
```

In this case, two stored fields were added, one in case for the `name` field and one for `name.text` multi-field.
This change prevents this, and would never store a stored field when text or match_only_text field is a multi-field.
@martijnvg martijnvg added backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :StorageEngine/Mapping The storage related side of mappings labels Jun 11, 2025
@elasticsearchmachine elasticsearchmachine merged commit 18adc3f into elastic:8.19 Jun 11, 2025
15 checks passed
@martijnvg martijnvg deleted the backport_129126 branch June 11, 2025 12:49
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 11, 2025
…match_only_text by default (elastic#129251)

Backporting elastic#129126 to 8.19 branch.

Don't store text and match_only_text field by default when source mode is synthetic and a field is a multi field or when there is a suitable multi field.

Without this change, ES would store field otherwise twice in a multi-field configuration.

For example:

```
...
"os": {
  "properties": {
    "name": {
      "ignore_above": 1024,
      "type": "keyword",
      "fields": {
        "text": {
          "type": "match_only_text"
        }
      }
    }
...
```

In this case, two stored fields were added, one in case for the `name` field and one for `name.text` multi-field.
This change prevents this, and would never store a stored field when text or match_only_text field is a multi-field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :StorageEngine/Mapping The storage related side of mappings v8.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants