2018-07-02 17:44:36 -04:00
|
|
|
[[painless-contexts]]
|
|
|
|
== Painless contexts
|
|
|
|
|
|
|
|
A 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.
|
|
|
|
|
|
|
|
[options="header",cols="<1,<1,<1"]
|
|
|
|
|====
|
|
|
|
| Name | Painless Documentation
|
|
|
|
| Elasticsearch Documentation
|
2018-08-09 17:24:55 -04:00
|
|
|
| Ingest processor | <<painless-ingest-processor-context, Painless Documentation>>
|
|
|
|
| {ref}/script-processor.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Update | <<painless-update-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/docs-update.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Update by query | <<painless-update-by-query-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/docs-update-by-query.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Reindex | <<painless-reindex-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/docs-reindex.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Sort | <<painless-sort-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-request-sort.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Similarity | <<painless-similarity-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/index-modules-similarity.html[Elasticsearch Documentation]
|
|
|
|
| Weight | <<painless-weight-context, Painless Documentation>>
|
|
|
|
| {ref}/index-modules-similarity.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Score | <<painless-score-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/query-dsl-function-score-query.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Field | <<painless-field-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-request-script-fields.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Filter | <<painless-filter-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/query-dsl-script-query.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Minimum should match | <<painless-min-should-match-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/query-dsl-terms-set-query.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Metric aggregation initialization | <<painless-metric-agg-init-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Metric aggregation map | <<painless-metric-agg-map-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Metric aggregation combine | <<painless-metric-agg-combine-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Metric aggregation reduce | <<painless-metric-agg-reduce-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]
|
2018-11-06 12:18:29 -05:00
|
|
|
| Bucket script aggregation | <<painless-bucket-script-agg-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {ref}/search-aggregations-pipeline-bucket-script-aggregation.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Watcher condition | <<painless-watcher-condition-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {xpack-ref}/condition-script.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
| Watcher transform | <<painless-watcher-transform-context, Painless Documentation>>
|
2018-07-25 13:59:25 -04:00
|
|
|
| {xpack-ref}/transform-script.html[Elasticsearch Documentation]
|
2018-07-02 17:44:36 -04:00
|
|
|
|====
|
|
|
|
|
2018-08-09 17:24:55 -04:00
|
|
|
include::painless-contexts/painless-context-examples.asciidoc[]
|
|
|
|
|
2018-07-02 17:44:36 -04:00
|
|
|
include::painless-contexts/index.asciidoc[]
|