Skip to content

Commit

Permalink
[DOCS] Rename example stored script (#83054) (#83062)
Browse files Browse the repository at this point in the history
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 #83038

(cherry picked from commit b413971)
  • Loading branch information
jrodewig authored Jan 25, 2022
1 parent c89964e commit a8e9b21
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/reference/ingest.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,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",
Expand All @@ -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
Expand Down

0 comments on commit a8e9b21

Please sign in to comment.