IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Painless contexts
editPainless contexts
editA Painless script is evaluated within a context. Each context has values that are available as local variables, a whitelist that controls the available classes, and the methods and fields within those classes (API), and if and what type of value is returned.
A Painless script is typically executed within one of the contexts in the table below. Note this is not necessarily a comprehensive list as custom plugins and specialized code may define new ways to use a Painless script.
Name | Painless Documentation | Elasticsearch Documentation |
---|---|---|
Update |
||
Update by query |
||
Reindex |
||
Sort |
||
Similarity |
||
Weight |
||
Score |
||
Field |
||
Filter |
||
Minimum should match |
||
Metric aggregation initialization |
||
Metric aggregation map |
||
Metric aggregation combine |
||
Metric aggregation reduce |
||
Bucket aggregation |
||
Ingest processor |
||
Watcher condition |
||
Watcher transform |