From 2ecd4a034c6fcdfb8c0b1ca1c128f33c2826688f Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Tue, 25 Jan 2022 10:17:33 -0500 Subject: [PATCH] [DOCS] Rename example stored script (#83054) Changes: * Renames the example stored script to avoid naming collisions with the [stored script API docs](https://www.elastic.co/guide/en/elasticsearch/reference/master/create-stored-script-api.html). * Adds a hidden snippet to delete the script for cleanup. Relates to https://github.com/elastic/elasticsearch/issues/83038 (cherry picked from commit b41397111c9dd86b6e1f115dd71b386be30302b4) --- docs/reference/ingest.asciidoc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/reference/ingest.asciidoc b/docs/reference/ingest.asciidoc index 5046e504f7031..64ddb74284f29 100644 --- a/docs/reference/ingest.asciidoc +++ b/docs/reference/ingest.asciidoc @@ -834,7 +834,7 @@ You can also specify a <> as the [source,console] ---- -PUT _scripts/my-stored-script +PUT _scripts/my-prod-tag-script { "script": { "lang": "painless", @@ -858,13 +858,21 @@ PUT _ingest/pipeline/my-pipeline { "drop": { "description": "Drop documents that don't contain 'prod' tag", - "if": { "id": "my-stored-script" } + "if": { "id": "my-prod-tag-script" } } } ] } ---- +//// +[source,console] +---- +DELETE _scripts/my-prod-tag-script +---- +// TEST[continued] +//// + Incoming documents often contain object fields. If a processor script attempts to access a field whose parent object does not exist, {es} returns a `NullPointerException`. To avoid these exceptions, use