mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
* [DOCS] Add documentation for Painless field API * Moving content to a new page and incorporating reviewer feedback * Clarify note * Incorporating review comments * Remove Object so as not to confuse it with the object type * Add section and table for supported mapped field types * Update table based on review feedback
66 lines
1.5 KiB
Text
66 lines
1.5 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/access-fields.asciidoc[]
|
|
|
|
include::scripting/common-script-uses.asciidoc[]
|
|
|
|
include::scripting/fields.asciidoc[]
|
|
|
|
include::scripting/security.asciidoc[]
|
|
|
|
include::scripting/expression.asciidoc[]
|
|
|
|
include::scripting/engine.asciidoc[]
|