Script APIs
Introduced 1.0
The script APIs allow you to work with both stored and inline scripts in OpenSearch. The default scripting language is Painless.
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:
- Get script contexts - List available contexts for stored scripts
- Get script languages - List supported scripting languages