This is a cache of https://www.elastic.co/guide/en/elasticsearch/painless/8.19/painless-scripts.html. It is a snapshot of the page as it appeared on 2025-11-22T03:25:24.646+0000.
Scripts | Painless Scripting Language [8.<strong>19</strong>] | Elastic
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

Scripts

edit

Scripts are composed of one-to-many statements and are run in a sandbox that determines what local variables are immediately available along with what APIs are allowed.