2019-05-21 13:47:47 -04:00
|
|
|
[[painless-guide]]
|
|
|
|
== Painless Guide
|
|
|
|
|
2017-05-12 19:17:06 -04:00
|
|
|
_Painless_ is a simple, secure scripting language designed specifically for use
|
|
|
|
with Elasticsearch. It is the default scripting language for Elasticsearch and
|
2019-05-21 13:47:47 -04:00
|
|
|
can safely be used for inline and stored scripts. For a jump start into
|
|
|
|
Painless, see <<painless-walkthrough, A Brief Painless Walkthrough>>. For a
|
|
|
|
detailed description of the Painless syntax and language features, see the
|
|
|
|
<<painless-lang-spec, Painless Language Specification>>.
|
2017-05-12 19:17:06 -04:00
|
|
|
|
2019-05-21 13:47:47 -04:00
|
|
|
You can use Painless anywhere scripts are used in Elasticsearch. Painless
|
2017-05-12 19:17:06 -04:00
|
|
|
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.
|
|
|
|
|
2019-05-21 13:47:47 -04:00
|
|
|
* Syntax: Extends a subset of Java's syntax to provide additional scripting
|
|
|
|
language features.
|
2017-05-12 19:17:06 -04:00
|
|
|
|
|
|
|
* Optimizations: Designed specifically for Elasticsearch scripting.
|
2019-05-21 13:47:47 -04:00
|
|
|
|
|
|
|
include::painless-guide/index.asciidoc[]
|