From 7b326bf35c458a168e1214600f2b92808ca77a37 Mon Sep 17 00:00:00 2001 From: gaobinlong Date: Wed, 4 Dec 2024 14:39:05 +0800 Subject: [PATCH 1/2] Document the usage of update document API with ingest pipeline Signed-off-by: gaobinlong --- _api-reference/document-apis/update-document.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_api-reference/document-apis/update-document.md b/_api-reference/document-apis/update-document.md index ff17940cdb..2ed8f27bb0 100644 --- a/_api-reference/document-apis/update-document.md +++ b/_api-reference/document-apis/update-document.md @@ -14,6 +14,11 @@ redirect_from: If you need to update a document's fields in your index, you can use the update document API operation. You can do so by specifying the new data you want to be in your index or by including a script in your request body, which OpenSearch runs to update the document. By default, the update operation only updates a document that exists in the index. If a document does not exist, the API returns an error. To _upsert_ a document (update the document that exists or index a new one), use the [upsert](#using-the-upsert-operation) operation. +You cannot specify any ingest pipeline explicitly when calling the update document API, but the pre-defined default pipeline or final pipeline can be executed under some conditions. Case that when performing upsert operation and a new document is indexed, the pre-defined default pipeline or final pipeline in the index is supposed to be executed. However, when performaing update operation for the existing document, the default pipeline or final pipeline is not supposed to be executed but actually it's executed, a deprecation warning header as follows will be returned, and the support will be removed in 3.0.0. +``` +the index [sample-index1] has a default ingest pipeline or a final ingest pipeline, the support of the ingest pipelines for update operation causes unexpected result and will be removed in 3.0.0 +``` + ## Path and HTTP methods ```json From 4bbf9d8999923ddaed5497f6c96ef98ff708206b Mon Sep 17 00:00:00 2001 From: gaobinlong Date: Mon, 9 Dec 2024 16:30:03 +0800 Subject: [PATCH 2/2] Update _api-reference/document-apis/update-document.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: gaobinlong --- _api-reference/document-apis/update-document.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_api-reference/document-apis/update-document.md b/_api-reference/document-apis/update-document.md index 2ed8f27bb0..8500fec101 100644 --- a/_api-reference/document-apis/update-document.md +++ b/_api-reference/document-apis/update-document.md @@ -14,7 +14,10 @@ redirect_from: If you need to update a document's fields in your index, you can use the update document API operation. You can do so by specifying the new data you want to be in your index or by including a script in your request body, which OpenSearch runs to update the document. By default, the update operation only updates a document that exists in the index. If a document does not exist, the API returns an error. To _upsert_ a document (update the document that exists or index a new one), use the [upsert](#using-the-upsert-operation) operation. -You cannot specify any ingest pipeline explicitly when calling the update document API, but the pre-defined default pipeline or final pipeline can be executed under some conditions. Case that when performing upsert operation and a new document is indexed, the pre-defined default pipeline or final pipeline in the index is supposed to be executed. However, when performaing update operation for the existing document, the default pipeline or final pipeline is not supposed to be executed but actually it's executed, a deprecation warning header as follows will be returned, and the support will be removed in 3.0.0. +You cannot explicitly specify an ingest pipeline when calling the Update Document API. If a `default_pipeline` or `final_pipeline` is defined in your index, the following behavior applies: + +- **Upsert operations**: When indexing a new document, the `default_pipeline` and `final_pipeline` defined in the index are executed as specified. +- **Update operations**: When updating an existing document, ingest pipeline execution is not recommended because it may produce erroneous results. Support for running ingest pipelines during update operations is deprecated and will be removed in version 3.0.0. If your index has a defined ingest pipeline, the update document operation will return the following deprecation warning: ``` the index [sample-index1] has a default ingest pipeline or a final ingest pipeline, the support of the ingest pipelines for update operation causes unexpected result and will be removed in 3.0.0 ```