Get a script or search template
- GET /_scripts/{id}
Path Parameters
-
idstring Idrequired -
The identifier for the stored script or search template.
Query Parameters
-
master_timeoutstring Duration · default: 30s The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. It can also be set to
-1to indicate that the request should never timeout.
Response
application/json
-
_idstring Idrequired -
foundbooleanrequired -
scriptStoredScript -
langScriptLanguagerequired -
The language the script is written in. For search templates, use
mustache.Supported values include:
painless: Painless scripting language, purpose-built for Elasticsearch.expression: Lucene’s expressions language, compiles a JavaScript expression to bytecode.mustache: Mustache templated, used for templates.java: Expert Java API
-
Values:
painlessexpressionmustachejava -
optionsmap string to string -
sourceScriptSourcerequired -
The script source. For search templates, an object containing the search template.