[[modules-scripting]] = Scripting [partintro] -- With scripting, you can evaluate custom expressions in {es}. For example, you could use a script to return "script fields" as part of a search request or evaluate a custom score for a query. The default scripting language is <>. Additional `lang` plugins enable you to run scripts written in other languages. Everywhere a script can be used, you can include a `lang` parameter to specify the language of the script. [float] == General-purpose languages These languages can be used for any purpose in the scripting APIs, and give the most flexibility. [cols="<,<,<",options="header",] |======================================================================= |Language |Sandboxed |Required plugin |<> |yes |built-in |======================================================================= [float] == Special-purpose languages These languages are less flexible, but typically have higher performance for certain tasks. [cols="<,<,<,<",options="header",] |======================================================================= |Language |Sandboxed |Required plugin |Purpose |<> |yes |built-in |fast custom ranking and sorting |<> |yes |built-in |templates |<> |n/a |you write it! |expert API |======================================================================= [WARNING] .Scripts and security ================================================= Languages that are sandboxed are designed with security in mind. However, non- sandboxed languages can be a security issue, please read <> for more details. ================================================= -- include::scripting/using.asciidoc[] include::scripting/fields.asciidoc[] include::scripting/security.asciidoc[] include::scripting/painless.asciidoc[] include::scripting/expression.asciidoc[] include::scripting/engine.asciidoc[]