mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
* Initial changes for scripting. * Shorten script examples. * Expanding types docs. * Updating types. * Fixing broken cross-link. * Fixing map error. * Incorporating review feedback. * Fixing broken table. * Adding more info about reference types. * Fixing broken path. * Adding more info an examples for def type. * Adding more info on operators. * Incorporating review feedback. * Adding notconsole for example. * Removing comments in example. * More review feedback. * Editorial changes. * Incorporating more reviewer feedback. * Rewrites based on review feedback. * Adding new sections for storing scripts and shortening scripts. * Adding redirect for stored scripts. * Adding DELETE for stored script plus link. * Adding section for updating docs with scripts. * Incorporating final feedback from reviews. * Tightening up a few areas. * Minor change around other languages. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
62 lines
1.4 KiB
Text
62 lines
1.4 KiB
Text
[[modules-scripting]]
|
|
= Scripting
|
|
|
|
[partintro]
|
|
--
|
|
With scripting, you can evaluate custom expressions in {es}. For example, you
|
|
can use a script to return a computed value as a field or evaluate a custom
|
|
score for a query.
|
|
|
|
The default scripting language is <<modules-scripting-painless,Painless>>.
|
|
Additional `lang` plugins are available to run scripts written in other
|
|
languages. You can specify the language of the script anywhere that scripts run.
|
|
|
|
[discrete]
|
|
[[scripting-available-languages]]
|
|
== Available scripting languages
|
|
|
|
Painless is purpose-built for {es}, can be used for any purpose in the
|
|
scripting APIs, and provides the most flexibility. The other languages are less
|
|
flexible, but can be useful for specific purposes.
|
|
|
|
[cols="<,<,<,<",options="header",]
|
|
|========
|
|
|Language
|
|
|Sandboxed
|
|
|Required plugin
|
|
|Purpose
|
|
|
|
|<<modules-scripting-painless,`painless`>>
|
|
|{yes-icon}
|
|
|Built-in
|
|
|Purpose-built for {es}
|
|
|
|
|<<modules-scripting-expression, `expression`>>
|
|
|{yes-icon}
|
|
|Built-in
|
|
|Fast custom ranking and sorting
|
|
|
|
|<<search-template, `mustache`>>
|
|
|{yes-icon}
|
|
|Built-in
|
|
|Templates
|
|
|
|
|<<modules-scripting-engine, `java`>>
|
|
|{no-icon}
|
|
|You write it!
|
|
|Expert API
|
|
|========
|
|
|
|
--
|
|
|
|
include::scripting/painless.asciidoc[]
|
|
|
|
include::scripting/using.asciidoc[]
|
|
|
|
include::scripting/fields.asciidoc[]
|
|
|
|
include::scripting/security.asciidoc[]
|
|
|
|
include::scripting/expression.asciidoc[]
|
|
|
|
include::scripting/engine.asciidoc[]
|