diff --git a/docs/reference/scripting/apis/create-stored-script-api.asciidoc b/docs/reference/scripting/apis/create-stored-script-api.asciidoc index a53472ce13ba9..6108831a836b1 100644 --- a/docs/reference/scripting/apis/create-stored-script-api.asciidoc +++ b/docs/reference/scripting/apis/create-stored-script-api.asciidoc @@ -13,14 +13,19 @@ PUT _scripts/my-stored-script { "script": { "lang": "painless", - "source": """ - TimestampHour date = doc['@timestamp'].value; - return date.getHour() - """ + "source": "Math.log(_score * 2) + params['my_modifier']" } } ---- +//// +[source,console] +---- +DELETE _scripts/my-stored-script +---- +// TEST[continued] +//// + [[create-stored-script-api-request]] ==== {api-request-title} diff --git a/docs/reference/scripting/apis/delete-stored-script-api.asciidoc b/docs/reference/scripting/apis/delete-stored-script-api.asciidoc index 7d74a7af26d5a..038d1916f76fd 100644 --- a/docs/reference/scripting/apis/delete-stored-script-api.asciidoc +++ b/docs/reference/scripting/apis/delete-stored-script-api.asciidoc @@ -14,10 +14,7 @@ PUT _scripts/my-stored-script { "script": { "lang": "painless", - "source": """ - TimestampHour date = doc['@timestamp'].value; - return date.getHour() - """ + "source": "Math.log(_score * 2) + params['my_modifier']" } } ---- diff --git a/docs/reference/scripting/apis/get-stored-script-api.asciidoc b/docs/reference/scripting/apis/get-stored-script-api.asciidoc index f7f974a1f5f1d..6b6f6648a7ed6 100644 --- a/docs/reference/scripting/apis/get-stored-script-api.asciidoc +++ b/docs/reference/scripting/apis/get-stored-script-api.asciidoc @@ -14,10 +14,7 @@ PUT _scripts/my-stored-script { "script": { "lang": "painless", - "source": """ - TimestampHour date = doc['@timestamp'].value; - return date.getHour() - """ + "source": "Math.log(_score * 2) + params['my_modifier']" } } ---- @@ -29,6 +26,14 @@ GET _scripts/my-stored-script ---- // TEST[continued] +//// +[source,console] +---- +DELETE _scripts/my-stored-script +---- +// TEST[continued] +//// + [[get-stored-script-api-request]] ==== {api-request-title}