From d2285c346eea037a6fd39bcdb9148794b04a00f1 Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 14:11:58 +0000 Subject: [PATCH 1/4] Move script update restrictions section for consistency --- .../mapping-reference/semantic-text.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/reference/elasticsearch/mapping-reference/semantic-text.md b/docs/reference/elasticsearch/mapping-reference/semantic-text.md index b639534626b88..1cad43568b0dc 100644 --- a/docs/reference/elasticsearch/mapping-reference/semantic-text.md +++ b/docs/reference/elasticsearch/mapping-reference/semantic-text.md @@ -440,6 +440,18 @@ If you want to avoid unnecessary inference and keep existing embeddings: * Use **partial updates through the Bulk API**. * Omit any `semantic_text` fields that did not change from the `doc` object in your request. +## Updates to `semantic_text` fields [update-script] + +For indices containing `semantic_text` fields, updates that use scripts have the +following behavior: + +* Are supported through + the [Update API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update). +* Are not supported through + the [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk-1) + and will fail. Even if the script targets non-`semantic_text` fields, the + update will fail when the index contains a `semantic_text` field. + ## Returning semantic field embeddings in `_source` ```{applies_to} @@ -578,18 +590,6 @@ PUT my-index-000004 ``` % TEST[skip:Requires inference endpoint] -## Updates to `semantic_text` fields [update-script] - -For indices containing `semantic_text` fields, updates that use scripts have the -following behavior: - -* Are supported through - the [Update API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update). -* Are not supported through - the [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk-1) - and will fail. Even if the script targets non-`semantic_text` fields, the - update will fail when the index contains a `semantic_text` field. - ## `copy_to` and multi-fields support [copy-to-support] The semantic_text field type can serve as the target From aa44fdc3fb050e9c2ea4968683bfa2724c0114fa Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 14:40:33 +0000 Subject: [PATCH 2/4] Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson --- .../elasticsearch/mapping-reference/semantic-text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/elasticsearch/mapping-reference/semantic-text.md b/docs/reference/elasticsearch/mapping-reference/semantic-text.md index 1cad43568b0dc..9a6452fdc5573 100644 --- a/docs/reference/elasticsearch/mapping-reference/semantic-text.md +++ b/docs/reference/elasticsearch/mapping-reference/semantic-text.md @@ -437,8 +437,8 @@ When updating documents that contain `semantic_text` fields, it’s important to If you want to avoid unnecessary inference and keep existing embeddings: - * Use **partial updates through the Bulk API**. - * Omit any `semantic_text` fields that did not change from the `doc` object in your request. + * Use **partial updates through the Bulk API**. + * Omit any `semantic_text` fields that did not change from the `doc` object in your request. ## Updates to `semantic_text` fields [update-script] From 85dc83021bf534ea4dc5db91d54f234a1d9a15d7 Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 14:40:48 +0000 Subject: [PATCH 3/4] Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson --- docs/reference/elasticsearch/mapping-reference/semantic-text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/elasticsearch/mapping-reference/semantic-text.md b/docs/reference/elasticsearch/mapping-reference/semantic-text.md index 9a6452fdc5573..69435abb76ca6 100644 --- a/docs/reference/elasticsearch/mapping-reference/semantic-text.md +++ b/docs/reference/elasticsearch/mapping-reference/semantic-text.md @@ -440,7 +440,7 @@ If you want to avoid unnecessary inference and keep existing embeddings: * Use **partial updates through the Bulk API**. * Omit any `semantic_text` fields that did not change from the `doc` object in your request. -## Updates to `semantic_text` fields [update-script] +### Scripted updates For indices containing `semantic_text` fields, updates that use scripts have the following behavior: From 0e28062911397df10fb7fe8fc77828a2ae2d55fc Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 14:41:01 +0000 Subject: [PATCH 4/4] Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson --- .../elasticsearch/mapping-reference/semantic-text.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/reference/elasticsearch/mapping-reference/semantic-text.md b/docs/reference/elasticsearch/mapping-reference/semantic-text.md index 69435abb76ca6..7ae0311031c70 100644 --- a/docs/reference/elasticsearch/mapping-reference/semantic-text.md +++ b/docs/reference/elasticsearch/mapping-reference/semantic-text.md @@ -445,12 +445,8 @@ If you want to avoid unnecessary inference and keep existing embeddings: For indices containing `semantic_text` fields, updates that use scripts have the following behavior: -* Are supported through - the [Update API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update). -* Are not supported through - the [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk-1) - and will fail. Even if the script targets non-`semantic_text` fields, the - update will fail when the index contains a `semantic_text` field. +- ✅ **Supported:** [Update API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update) +- ❌ **Not supported:** [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk-1). Scripted updates will fail even if the script targets non-`semantic_text` fields. ## Returning semantic field embeddings in `_source`