Skip to content

[Search] Fix: Only run ML saved object check if saving semantic text mapping#248462

Merged
seialkali merged 1 commit intoelastic:mainfrom
seialkali:fix-save-mappings-basic-license
Jan 9, 2026
Merged

[Search] Fix: Only run ML saved object check if saving semantic text mapping#248462
seialkali merged 1 commit intoelastic:mainfrom
seialkali:fix-save-mappings-basic-license

Conversation

@seialkali
Copy link
Contributor

@seialkali seialkali commented Jan 9, 2026

Summary

When running Elasticsearch with a Basic license, attempting to update index mappings could fail even when adding non-ML field types. This happened because, during mapping updates, we unconditionally made a synchronous call to fetch the latest ML data from Saved Objects. That call requires a Platinum license and therefore fails under a Basic license.

This change guards the sync call behind explicit checks for both ML and semantic text permissions (which require a Platinum license), and only executes it when a semantic_text field is being saved. This prevents mapping updates from failing on lower license tiers while preserving the existing behavior for semantic text fields.

Testing

To test this PR you will need to confirm that you can save mappings with both a basic and trial license. You will also need to run EIS locally with a trial license:

Basic license

  1. Run Elasticsearch with a basic license: yarn es snapshot
  2. Create an index
  3. Confirm you can add a field and successfully save the mapping

Trial license

  1. Run Elasticsearch with a trial license: yarn es snapshot --license trial
  2. Run EIS locally. You can find the instructions in the EIS script README.
  3. Create an index
  4. Confirm you can add a semantic_text field and successfully save the mapping

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Release note

Fixes an issue when running Elasticsearch with a Basic license, where users might encounter errors when updating index mappings, even when adding non-ML field types. This issue has been resolved so that mapping updates now work as expected, while advanced semantic text features continue to require the appropriate license.

Copy link
Contributor

@SoniaSanzV SoniaSanzV left a comment

Choose a reason for hiding this comment

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

tested locally, lgtm! Thank you for the thorough PR descrption.

@seialkali seialkali enabled auto-merge (squash) January 9, 2026 15:37
@seialkali seialkali merged commit 77bd7f9 into elastic:main Jan 9, 2026
32 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/20859609462

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 9, 2026
…mapping (elastic#248462)

## Summary

When running Elasticsearch with a Basic license, attempting to update
index mappings could fail even when adding non-ML field types. This
happened because, during mapping updates, we unconditionally made a
synchronous call to fetch the latest ML data from Saved Objects. That
call requires a Platinum license and therefore fails under a Basic
license.

This change guards the sync call behind explicit checks for both ML and
semantic text permissions (which require a Platinum license), and only
executes it when a semantic_text field is being saved. This prevents
mapping updates from failing on lower license tiers while preserving the
existing behavior for semantic text fields.

## Testing

To test this PR you will need to confirm that you can save mappings with
both a basic and trial license. You will also need to run EIS locally
with a trial license:

### Basic license
1. Run Elasticsearch with a basic license: `yarn es snapshot`
2. Create an index
3. Confirm you can add a field and successfully save the mapping

### Trial license
1. Run Elasticsearch with a trial license: `yarn es snapshot --license
trial`
2. Run EIS locally. You can find the instructions in the [EIS script
README](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).
3. Create an index
3. Confirm you can add a `semantic_text` field and successfully save the
mapping

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

## Release note
Fixes an issue when running Elasticsearch with a Basic license, where
users might encounter errors when updating index mappings, even when
adding non-ML field types. This issue has been resolved so that mapping
updates now work as expected, while advanced semantic text features
continue to require the appropriate license.

(cherry picked from commit 77bd7f9)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 9, 2026
…mapping (elastic#248462)

## Summary

When running Elasticsearch with a Basic license, attempting to update
index mappings could fail even when adding non-ML field types. This
happened because, during mapping updates, we unconditionally made a
synchronous call to fetch the latest ML data from Saved Objects. That
call requires a Platinum license and therefore fails under a Basic
license.

This change guards the sync call behind explicit checks for both ML and
semantic text permissions (which require a Platinum license), and only
executes it when a semantic_text field is being saved. This prevents
mapping updates from failing on lower license tiers while preserving the
existing behavior for semantic text fields.

## Testing

To test this PR you will need to confirm that you can save mappings with
both a basic and trial license. You will also need to run EIS locally
with a trial license:

### Basic license
1. Run Elasticsearch with a basic license: `yarn es snapshot`
2. Create an index
3. Confirm you can add a field and successfully save the mapping

### Trial license
1. Run Elasticsearch with a trial license: `yarn es snapshot --license
trial`
2. Run EIS locally. You can find the instructions in the [EIS script
README](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).
3. Create an index
3. Confirm you can add a `semantic_text` field and successfully save the
mapping

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

## Release note
Fixes an issue when running Elasticsearch with a Basic license, where
users might encounter errors when updating index mappings, even when
adding non-ML field types. This issue has been resolved so that mapping
updates now work as expected, while advanced semantic text features
continue to require the appropriate license.

(cherry picked from commit 77bd7f9)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 9, 2026
…mapping (elastic#248462)

## Summary

When running Elasticsearch with a Basic license, attempting to update
index mappings could fail even when adding non-ML field types. This
happened because, during mapping updates, we unconditionally made a
synchronous call to fetch the latest ML data from Saved Objects. That
call requires a Platinum license and therefore fails under a Basic
license.

This change guards the sync call behind explicit checks for both ML and
semantic text permissions (which require a Platinum license), and only
executes it when a semantic_text field is being saved. This prevents
mapping updates from failing on lower license tiers while preserving the
existing behavior for semantic text fields.

## Testing

To test this PR you will need to confirm that you can save mappings with
both a basic and trial license. You will also need to run EIS locally
with a trial license:

### Basic license
1. Run Elasticsearch with a basic license: `yarn es snapshot`
2. Create an index
3. Confirm you can add a field and successfully save the mapping

### Trial license
1. Run Elasticsearch with a trial license: `yarn es snapshot --license
trial`
2. Run EIS locally. You can find the instructions in the [EIS script
README](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).
3. Create an index
3. Confirm you can add a `semantic_text` field and successfully save the
mapping

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

## Release note
Fixes an issue when running Elasticsearch with a Basic license, where
users might encounter errors when updating index mappings, even when
adding non-ML field types. This issue has been resolved so that mapping
updates now work as expected, while advanced semantic text features
continue to require the appropriate license.

(cherry picked from commit 77bd7f9)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1
9.2
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 9, 2026
… text mapping (#248462) (#248502)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Search] Fix: Only run ML saved object check if saving semantic text
mapping (#248462)](#248462)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Brittany","email":"seialkali@gmail.com"},"sourceCommit":{"committedDate":"2026-01-09T17:11:22Z","message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Search","backport:version","v9.3.0","v9.4.0","v9.2.4","v9.1.10"],"title":"[Search]
Fix: Only run ML saved object check if saving semantic text
mapping","number":248462,"url":"https://github.com/elastic/kibana/pull/248462","mergeCommit":{"message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2","9.1"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248462","number":248462,"mergeCommit":{"message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e"}},{"branch":"9.2","label":"v9.2.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Brittany <seialkali@gmail.com>
kibanamachine added a commit that referenced this pull request Jan 9, 2026
… text mapping (#248462) (#248499)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Search] Fix: Only run ML saved object check if saving semantic text
mapping (#248462)](#248462)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Brittany","email":"seialkali@gmail.com"},"sourceCommit":{"committedDate":"2026-01-09T17:11:22Z","message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Search","backport:version","v9.3.0","v9.4.0","v9.2.4","v9.1.10"],"title":"[Search]
Fix: Only run ML saved object check if saving semantic text
mapping","number":248462,"url":"https://github.com/elastic/kibana/pull/248462","mergeCommit":{"message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2","9.1"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248462","number":248462,"mergeCommit":{"message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e"}},{"branch":"9.2","label":"v9.2.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Brittany <seialkali@gmail.com>
kibanamachine added a commit that referenced this pull request Jan 9, 2026
… text mapping (#248462) (#248501)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Search] Fix: Only run ML saved object check if saving semantic text
mapping (#248462)](#248462)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Brittany","email":"seialkali@gmail.com"},"sourceCommit":{"committedDate":"2026-01-09T17:11:22Z","message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Search","backport:version","v9.3.0","v9.4.0","v9.2.4","v9.1.10"],"title":"[Search]
Fix: Only run ML saved object check if saving semantic text
mapping","number":248462,"url":"https://github.com/elastic/kibana/pull/248462","mergeCommit":{"message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2","9.1"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248462","number":248462,"mergeCommit":{"message":"[Search]
Fix: Only run ML saved object check if saving semantic text mapping
(#248462)\n\n## Summary\n\nWhen running Elasticsearch with a Basic
license, attempting to update\nindex mappings could fail even when
adding non-ML field types. This\nhappened because, during mapping
updates, we unconditionally made a\nsynchronous call to fetch the latest
ML data from Saved Objects. That\ncall requires a Platinum license and
therefore fails under a Basic\nlicense.\n\nThis change guards the sync
call behind explicit checks for both ML and\nsemantic text permissions
(which require a Platinum license), and only\nexecutes it when a
semantic_text field is being saved. This prevents\nmapping updates from
failing on lower license tiers while preserving the\nexisting behavior
for semantic text fields.\n\n## Testing\n\nTo test this PR you will need
to confirm that you can save mappings with\nboth a basic and trial
license. You will also need to run EIS locally\nwith a trial
license:\n\n### Basic license\n1. Run Elasticsearch with a basic
license: `yarn es snapshot`\n2. Create an index\n3. Confirm you can add
a field and successfully save the mapping\n\n### Trial license\n1. Run
Elasticsearch with a trial license: `yarn es snapshot
--license\ntrial`\n2. Run EIS locally. You can find the instructions in
the [EIS
script\nREADME](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).\n3.
Create an index\n3. Confirm you can add a `semantic_text` field and
successfully save the\nmapping\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n## Release note\nFixes an issue
when running Elasticsearch with a Basic license, where\nusers might
encounter errors when updating index mappings, even when\nadding non-ML
field types. This issue has been resolved so that mapping\nupdates now
work as expected, while advanced semantic text features\ncontinue to
require the appropriate
license.","sha":"77bd7f9e12f49628077aad74a252dd090b05590e"}},{"branch":"9.2","label":"v9.2.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Brittany <seialkali@gmail.com>
devamanv pushed a commit to devamanv/kibana that referenced this pull request Jan 12, 2026
…mapping (elastic#248462)

## Summary

When running Elasticsearch with a Basic license, attempting to update
index mappings could fail even when adding non-ML field types. This
happened because, during mapping updates, we unconditionally made a
synchronous call to fetch the latest ML data from Saved Objects. That
call requires a Platinum license and therefore fails under a Basic
license.

This change guards the sync call behind explicit checks for both ML and
semantic text permissions (which require a Platinum license), and only
executes it when a semantic_text field is being saved. This prevents
mapping updates from failing on lower license tiers while preserving the
existing behavior for semantic text fields.

## Testing

To test this PR you will need to confirm that you can save mappings with
both a basic and trial license. You will also need to run EIS locally
with a trial license:

### Basic license
1. Run Elasticsearch with a basic license: `yarn es snapshot`
2. Create an index
3. Confirm you can add a field and successfully save the mapping

### Trial license
1. Run Elasticsearch with a trial license: `yarn es snapshot --license
trial`
2. Run EIS locally. You can find the instructions in the [EIS script
README](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-inference-cli/README.md).
3. Create an index
3. Confirm you can add a `semantic_text` field and successfully save the
mapping

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

## Release note
Fixes an issue when running Elasticsearch with a Basic license, where
users might encounter errors when updating index mappings, even when
adding non-ML field types. This issue has been resolved so that mapping
updates now work as expected, while advanced semantic text features
continue to require the appropriate license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment