Browse Source

[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
James Rodewig 3 years ago
parent
commit
b41397111c
1 changed files with 10 additions and 2 deletions
  1. 10 2
      docs/reference/ingest.asciidoc

+ 10 - 2
docs/reference/ingest.asciidoc

@@ -848,7 +848,7 @@ You can also specify a <<modules-scripting-stored-scripts,stored script>> as the
 
 [source,console]
 ----
-PUT _scripts/my-stored-script
+PUT _scripts/my-prod-tag-script
 {
   "script": {
     "lang": "painless",
@@ -872,13 +872,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