Delete a script or search template
Generally available
Deletes a stored script or search template.
highlight#highlightFromAnchor" href="#topic-required-authorization"> Required authorization
- Cluster privileges:
manage
Query parameters
-
The period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to
-1
to indicate that the request should never timeout.Values are
-1
or0
. -
The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to
-1
to indicate that the request should never timeout.Values are
-1
or0
.
DELETE
/_scripts/{id}
dropdown#toggle click@window->dropdown#hide touchend@window->dropdown#hide"
data-dropdown-target="button"
data-scrollable="false"
data-headings="false"
aria-expanded="false"
aria-haspopup="true"
role="menu"
tabindex="0">
Console
DELETE _scripts/my-search-template
resp = client.delete_script(
id="my-search-template",
)
const response = await client.deleteScript({
id: "my-search-template",
});
response = client.delete_script(
id: "my-search-template"
)
$resp = $client->deleteScript([
"id" => "my-search-template",
]);
curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_scripts/my-search-template"
client.deleteScript(d -> d
.id("my-search-template")
);