mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Reorganise scripting docs (#18132)
* Reorganize scripting documentation * Further changes to tidy up scripting docs Closes #18116 * Add note about .lat/lon potentially returning null * Added .value to expressions example * Fixed two bad ASCIIDOC links
This commit is contained in:
parent
5a0cfdd6af
commit
34d90b041f
11 changed files with 1108 additions and 777 deletions
|
@ -1,5 +1,104 @@
|
|||
include::scripting/scripting.asciidoc[]
|
||||
[[modules-scripting]]
|
||||
== Scripting
|
||||
|
||||
The scripting module enables you to use scripts to evaluate custom
|
||||
expressions. 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.
|
||||
|
||||
TIP: Elasticsearch now has a built-in scripting language called _Painless_
|
||||
that provides a more secure alternative for implementing
|
||||
scripts for Elasticsearch. We encourage you to try it out --
|
||||
for more information, see <<modules-scripting-painless, Painless Scripting Language>>.
|
||||
|
||||
The default scripting language is http://groovy-lang.org/[groovy].
|
||||
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
|
||||
|
||||
|<<modules-scripting-painless, `painless`>>
|
||||
|yes
|
||||
|built-in
|
||||
|
||||
|<<modules-scripting-groovy, `groovy`>>
|
||||
|<<modules-scripting-security, no>>
|
||||
|built-in
|
||||
|
||||
|{plugins}/lang-javascript.html[`javascript`]
|
||||
|<<modules-scripting-security, no>>
|
||||
|{plugins}/lang-javascript.html[`lang-javascript`]
|
||||
|
||||
|{plugins}/lang-python.html[`python`]
|
||||
|<<modules-scripting-security, no>>
|
||||
|{plugins}/lang-python.html[`lang-python`]
|
||||
|
||||
|=======================================================================
|
||||
|
||||
[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
|
||||
|
||||
|<<modules-scripting-expression, `expression`>>
|
||||
|yes
|
||||
|built-in
|
||||
|fast custom ranking and sorting
|
||||
|
||||
|<<search-template, `mustache`>>
|
||||
|yes
|
||||
|built-in
|
||||
|templates
|
||||
|
||||
|<<modules-scripting-native, `java`>>
|
||||
|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
|
||||
<<modules-scripting-security, Scripting and security>> for more details.
|
||||
|
||||
=================================================
|
||||
|
||||
|
||||
include::scripting/using.asciidoc[]
|
||||
|
||||
include::scripting/fields.asciidoc[]
|
||||
|
||||
include::scripting/security.asciidoc[]
|
||||
|
||||
include::scripting/groovy.asciidoc[]
|
||||
|
||||
include::scripting/painless.asciidoc[]
|
||||
|
||||
include::scripting/expression.asciidoc[]
|
||||
|
||||
include::scripting/native.asciidoc[]
|
||||
|
||||
include::scripting/advanced-scripting.asciidoc[]
|
||||
|
||||
include::scripting/security.asciidoc[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue