Files

1.9 KiB

layout, title, has_children, has_toc, nav_order, redirect_from
layout title has_children has_toc nav_order redirect_from
default Script APIs true false 90
/opensearch/rest-api/script-apis/
/api-reference/script-apis/

Script APIs

Introduced 1.0 {: .label .label-purple }

The script APIs allow you to work with both stored and inline scripts in OpenSearch. The default scripting language is Painless. For more information, see Painless scripting language.

Types of scripts

OpenSearch supports two types of scripts:

  • Inline scripts: Scripts defined directly within API requests. They are compiled each time they are executed.
  • Stored scripts: Precompiled scripts saved in the cluster state that can be reused across multiple requests. They reduce compilation time and enhance search speed.

Script API operations

OpenSearch supports the following script API operations.

Inline script operations

Execute scripts directly without saving them to the cluster state:

Stored script operations

Manage precompiled scripts saved in the cluster state:

Script information

Get information about available script contexts and languages: