2016-03-18 17:07:43 -04:00
|
|
|
[[modules-scripting-painless]]
|
2016-05-04 12:17:10 -04:00
|
|
|
=== Painless Scripting Language
|
2016-03-18 17:07:43 -04:00
|
|
|
|
2019-05-21 13:47:47 -04:00
|
|
|
_Painless_ is a simple, secure scripting language designed specifically for use
|
|
|
|
with Elasticsearch. It is the default scripting language for Elasticsearch and
|
|
|
|
can safely be used for inline and stored scripts. To get started with
|
|
|
|
Painless, see the {painless}/painless-guide.html[Painless Guide]. For a
|
|
|
|
detailed description of the Painless syntax and language features, see the
|
|
|
|
{painless}/painless-lang-spec.html[Painless Language Specification].
|
2016-03-18 17:07:43 -04:00
|
|
|
|
2019-05-21 13:47:47 -04:00
|
|
|
[[painless-features]]
|
|
|
|
You can use Painless anywhere scripts can be used in Elasticsearch. Painless
|
|
|
|
provides:
|
|
|
|
|
|
|
|
* Fast performance: Painless scripts https://benchmarks.elastic.co/index.html#search_qps_scripts[
|
|
|
|
run several times faster] than the alternatives.
|
|
|
|
|
|
|
|
* Safety: Fine-grained whitelist with method call/field granularity. See the
|
|
|
|
{painless}/painless-api-reference.html[Painless API Reference] for a
|
|
|
|
complete list of available classes and methods.
|
|
|
|
|
|
|
|
* Optional typing: Variables and parameters can use explicit types or the
|
|
|
|
dynamic `def` type.
|
|
|
|
|
|
|
|
* Syntax: Extends a subset of Java's syntax to provide additional scripting
|
|
|
|
language features.
|
|
|
|
|
|
|
|
* Optimizations: Designed specifically for Elasticsearch scripting.
|
|
|
|
|
|
|
|
Ready to start scripting with Painless? See the
|
|
|
|
{painless}/painless-guide.html[Painless Guide] for the
|
2017-05-02 17:37:45 -04:00
|
|
|
{painless}/index.html[Painless Scripting Language].
|