diff --git a/docs/painless/painless-contexts.asciidoc b/docs/painless/painless-contexts.asciidoc index ff46f6bd74dde..8b8a3b0eec6b4 100644 --- a/docs/painless/painless-contexts.asciidoc +++ b/docs/painless/painless-contexts.asciidoc @@ -1,9 +1,6 @@ [[painless-contexts]] == Painless contexts -:es_version: https://www.elastic.co/guide/en/elasticsearch/reference/master -:xp_version: https://www.elastic.co/guide/en/x-pack/current - 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 @@ -18,41 +15,41 @@ specialized code may define new ways to use a Painless script. | Name | Painless Documentation | Elasticsearch Documentation | Update | <> - | {es_version}/docs-update.html[Elasticsearch Documentation] + | {ref}/docs-update.html[Elasticsearch Documentation] | Update by query | <> - | {es_version}/docs-update-by-query.html[Elasticsearch Documentation] + | {ref}/docs-update-by-query.html[Elasticsearch Documentation] | Reindex | <> - | {es_version}/docs-reindex.html[Elasticsearch Documentation] + | {ref}/docs-reindex.html[Elasticsearch Documentation] | Sort | <> - | {es_version}/search-request-sort.html[Elasticsearch Documentation] + | {ref}/search-request-sort.html[Elasticsearch Documentation] | Similarity | <> - | {es_version}/index-modules-similarity.html[Elasticsearch Documentation] -| Weight | <> - | {es_version}/index-modules-similarity.html[Elasticsearch Documentation] + | {ref}/index-modules-similarity.html[Elasticsearch Documentation] +| Weight | <> + | {ref}/index-modules-similarity.html[Elasticsearch Documentation] | Score | <> - | {es_version}/query-dsl-function-score-query.html[Elasticsearch Documentation] + | {ref}/query-dsl-function-score-query.html[Elasticsearch Documentation] | Field | <> - | {es_version}/search-request-script-fields.html[Elasticsearch Documentation] + | {ref}/search-request-script-fields.html[Elasticsearch Documentation] | Filter | <> - | {es_version}/query-dsl-script-query.html[Elasticsearch Documentation] + | {ref}/query-dsl-script-query.html[Elasticsearch Documentation] | Minimum should match | <> - | {es_version}/query-dsl-terms-set-query.html[Elasticsearch Documentation] + | {ref}/query-dsl-terms-set-query.html[Elasticsearch Documentation] | Metric aggregation initialization | <> - | {es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] + | {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] | Metric aggregation map | <> - | {es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] + | {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] | Metric aggregation combine | <> - | {es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] + | {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] | Metric aggregation reduce | <> - | {es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] + | {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation] | Bucket aggregation | <> - | {es_version}/search-aggregations-pipeline-bucket-script-aggregation.html[Elasticsearch Documentation] + | {ref}/search-aggregations-pipeline-bucket-script-aggregation.html[Elasticsearch Documentation] | Ingest processor | <> - | {es_version}/script-processor.html[Elasticsearch Documentation] + | {ref}/script-processor.html[Elasticsearch Documentation] | Watcher condition | <> - | {xp_version}/condition-script.html[Elasticsearch Documentation] + | {xpack-ref}/condition-script.html[Elasticsearch Documentation] | Watcher transform | <> - | {xp_version}/transform-script.html[Elasticsearch Documentation] + | {xpack-ref}/transform-script.html[Elasticsearch Documentation] |==== include::painless-contexts/index.asciidoc[] diff --git a/docs/painless/painless-contexts/painless-bucket-agg-context.asciidoc b/docs/painless/painless-contexts/painless-bucket-agg-context.asciidoc index b277055d87d8b..3bb4cae3d3bab 100644 --- a/docs/painless/painless-contexts/painless-bucket-agg-context.asciidoc +++ b/docs/painless/painless-contexts/painless-bucket-agg-context.asciidoc @@ -2,7 +2,7 @@ === Bucket aggregation context Use a Painless script in an -{es_version}/search-aggregations-pipeline-bucket-script-aggregation.html[bucket aggregation] +{ref}/search-aggregations-pipeline-bucket-script-aggregation.html[bucket aggregation] to calculate a value as a result in a bucket. *Variables* diff --git a/docs/painless/painless-contexts/painless-field-context.asciidoc b/docs/painless/painless-contexts/painless-field-context.asciidoc index bf44703001bc0..4c767ca389115 100644 --- a/docs/painless/painless-contexts/painless-field-context.asciidoc +++ b/docs/painless/painless-contexts/painless-field-context.asciidoc @@ -2,7 +2,7 @@ === Field context Use a Painless script to create a -{es_version}/search-request-script-fields.html[script field] to return +{ref}/search-request-script-fields.html[script field] to return a customized value for each document in the results of a query. *Variables* @@ -14,7 +14,7 @@ a customized value for each document in the results of a query. Contains the fields of the specified document where each field is a `List` of values. -{es_version}/mapping-source-field.html[`ctx['_source']`] (`Map`):: +{ref}/mapping-source-field.html[`ctx['_source']`] (`Map`):: Contains extracted JSON in a `Map` and `List` structure for the fields existing in a stored document. diff --git a/docs/painless/painless-contexts/painless-filter-context.asciidoc b/docs/painless/painless-contexts/painless-filter-context.asciidoc index ea0393893c882..96fddf13b500d 100644 --- a/docs/painless/painless-contexts/painless-filter-context.asciidoc +++ b/docs/painless/painless-contexts/painless-filter-context.asciidoc @@ -1,7 +1,7 @@ [[painless-filter-context]] === Filter context -Use a Painless script as a {es_version}/query-dsl-script-query.html[filter] in a +Use a Painless script as a {ref}/query-dsl-script-query.html[filter] in a query to include and exclude documents. diff --git a/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc b/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc index ba3be0739631f..5d451268dedcd 100644 --- a/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc +++ b/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc @@ -1,7 +1,7 @@ [[painless-ingest-processor-context]] === Ingest processor context -Use a Painless script in an {es_version}/script-processor.html[ingest processor] +Use a Painless script in an {ref}/script-processor.html[ingest processor] to modify documents upon insertion. *Variables* @@ -9,10 +9,10 @@ to modify documents upon insertion. `params` (`Map`, read-only):: User-defined parameters passed in as part of the query. -{es_version}/mapping-index-field.html[`ctx['_index']`] (`String`):: +{ref}/mapping-index-field.html[`ctx['_index']`] (`String`):: The name of the index. -{es_version}/mapping-type-field.html[`ctx['_type']`] (`String`):: +{ref}/mapping-type-field.html[`ctx['_type']`] (`String`):: The type of document within an index. `ctx` (`Map`):: @@ -21,10 +21,10 @@ to modify documents upon insertion. *Side Effects* -{es_version}/mapping-index-field.html[`ctx['_index']`]:: +{ref}/mapping-index-field.html[`ctx['_index']`]:: Modify this to change the destination index for the current document. -{es_version}/mapping-type-field.html[`ctx['_type']`]:: +{ref}/mapping-type-field.html[`ctx['_type']`]:: Modify this to change the type for the current document. `ctx` (`Map`, read-only):: diff --git a/docs/painless/painless-contexts/painless-metric-agg-combine-context.asciidoc b/docs/painless/painless-contexts/painless-metric-agg-combine-context.asciidoc index 1fec63ef4466f..31cb596ae8167 100644 --- a/docs/painless/painless-contexts/painless-metric-agg-combine-context.asciidoc +++ b/docs/painless/painless-contexts/painless-metric-agg-combine-context.asciidoc @@ -2,7 +2,7 @@ === Metric aggregation combine context Use a Painless script to -{es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[combine] +{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[combine] values for use in a scripted metric aggregation. A combine script is run once per shard following a <> and is optional as part of a full metric aggregation. diff --git a/docs/painless/painless-contexts/painless-metric-agg-init-context.asciidoc b/docs/painless/painless-contexts/painless-metric-agg-init-context.asciidoc index ed7e01ddd003a..1503e3abb5891 100644 --- a/docs/painless/painless-contexts/painless-metric-agg-init-context.asciidoc +++ b/docs/painless/painless-contexts/painless-metric-agg-init-context.asciidoc @@ -2,7 +2,7 @@ === Metric aggregation initialization context Use a Painless script to -{es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[initialize] +{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[initialize] values for use in a scripted metric aggregation. An initialization script is run prior to document collection once per shard and is optional as part of the full metric aggregation. diff --git a/docs/painless/painless-contexts/painless-metric-agg-map-context.asciidoc b/docs/painless/painless-contexts/painless-metric-agg-map-context.asciidoc index 51f06e010db35..16016d1cf8171 100644 --- a/docs/painless/painless-contexts/painless-metric-agg-map-context.asciidoc +++ b/docs/painless/painless-contexts/painless-metric-agg-map-context.asciidoc @@ -2,7 +2,7 @@ === Metric aggregation map context Use a Painless script to -{es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[map] +{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[map] values for use in a scripted metric aggregation. A map script is run once per collected document following an optional <> and is required as diff --git a/docs/painless/painless-contexts/painless-metric-agg-reduce-context.asciidoc b/docs/painless/painless-contexts/painless-metric-agg-reduce-context.asciidoc index 1b64b85392d26..b76e02b1b0499 100644 --- a/docs/painless/painless-contexts/painless-metric-agg-reduce-context.asciidoc +++ b/docs/painless/painless-contexts/painless-metric-agg-reduce-context.asciidoc @@ -2,7 +2,7 @@ === Metric aggregation reduce context Use a Painless script to -{es_version}/search-aggregations-metrics-scripted-metric-aggregation.html[reduce] +{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[reduce] values to produce the result of a scripted metric aggregation. A reduce script is run once on the coordinating node following a <> (or a diff --git a/docs/painless/painless-contexts/painless-min-should-match-context.asciidoc b/docs/painless/painless-contexts/painless-min-should-match-context.asciidoc index c310f42928eb4..b2ffb63fd7aea 100644 --- a/docs/painless/painless-contexts/painless-min-should-match-context.asciidoc +++ b/docs/painless/painless-contexts/painless-min-should-match-context.asciidoc @@ -2,7 +2,7 @@ === Minimum should match context Use a Painless script to specify the -{es_version}/query-dsl-terms-set-query.html[minimum] number of terms that a +{ref}/query-dsl-terms-set-query.html[minimum] number of terms that a specified field needs to match with for a document to be part of the query results. diff --git a/docs/painless/painless-contexts/painless-reindex-context.asciidoc b/docs/painless/painless-contexts/painless-reindex-context.asciidoc index a8477c8c61996..ae5445183a6ad 100644 --- a/docs/painless/painless-contexts/painless-reindex-context.asciidoc +++ b/docs/painless/painless-contexts/painless-reindex-context.asciidoc @@ -1,7 +1,7 @@ [[painless-reindex-context]] === Reindex context -Use a Painless script in a {es_version}/docs-reindex.html[reindex] operation to +Use a Painless script in a {ref}/docs-reindex.html[reindex] operation to add, modify, or delete fields within each document in an original index as its reindexed into a target index. @@ -13,22 +13,22 @@ reindexed into a target index. `ctx['_op']` (`String`):: The name of the operation. -{es_version}/mapping-routing-field.html[`ctx['_routing']`] (`String`):: +{ref}/mapping-routing-field.html[`ctx['_routing']`] (`String`):: The value used to select a shard for document storage. -{es_version}/mapping-index-field.html[`ctx['_index']`] (`String`):: +{ref}/mapping-index-field.html[`ctx['_index']`] (`String`):: The name of the index. -{es_version}/mapping-type-field.html[`ctx['_type']`] (`String`):: +{ref}/mapping-type-field.html[`ctx['_type']`] (`String`):: The type of document within an index. -{es_version}/mapping-id-field.html[`ctx['_id']`] (`int`, read-only):: +{ref}/mapping-id-field.html[`ctx['_id']`] (`int`, read-only):: The unique document id. `ctx['_version']` (`int`):: The current version of the document. -{es_version}/mapping-source-field.html[`ctx['_source']`] (`Map`):: +{ref}/mapping-source-field.html[`ctx['_source']`] (`Map`):: Contains extracted JSON in a `Map` and `List` structure for the fields existing in a stored document. @@ -39,22 +39,22 @@ reindexed into a target index. specify no operation or `delete` to delete the current document from the index. -{es_version}/mapping-routing-field.html[`ctx['_routing']`]:: +{ref}/mapping-routing-field.html[`ctx['_routing']`]:: Modify this to change the routing value for the current document. -{es_version}/mapping-index-field.html[`ctx['_index']`]:: +{ref}/mapping-index-field.html[`ctx['_index']`]:: Modify this to change the destination index for the current document. -{es_version}/mapping-type-field.html[`ctx['_type']`]:: +{ref}/mapping-type-field.html[`ctx['_type']`]:: Modify this to change the type for the current document. -{es_version}/mapping-id-field.html[`ctx['_id']`]:: +{ref}/mapping-id-field.html[`ctx['_id']`]:: Modify this to change the id for the current document. `ctx['_version']` (`int`):: Modify this to modify the version for the current document. -{es_version}/mapping-source-field.html[`ctx['_source']`]:: +{ref}/mapping-source-field.html[`ctx['_source']`]:: Modify the values in the `Map/List` structure to add, modify, or delete the fields of a document. diff --git a/docs/painless/painless-contexts/painless-score-context.asciidoc b/docs/painless/painless-contexts/painless-score-context.asciidoc index 21667fd31f3b1..bd1e1de7f777d 100644 --- a/docs/painless/painless-contexts/painless-score-context.asciidoc +++ b/docs/painless/painless-contexts/painless-score-context.asciidoc @@ -2,7 +2,7 @@ === Score context Use a Painless script in a -{es_version}/query-dsl-function-score-query.html[function score] to apply a new +{ref}/query-dsl-function-score-query.html[function score] to apply a new score to documents returned from a query. *Variables* diff --git a/docs/painless/painless-contexts/painless-similarity-context.asciidoc b/docs/painless/painless-contexts/painless-similarity-context.asciidoc index 052844c3111a7..53b37be52b6d7 100644 --- a/docs/painless/painless-contexts/painless-similarity-context.asciidoc +++ b/docs/painless/painless-contexts/painless-similarity-context.asciidoc @@ -2,7 +2,7 @@ === Similarity context Use a Painless script to create a -{es_version}/index-modules-similarity.html[similarity] equation for scoring +{ref}/index-modules-similarity.html[similarity] equation for scoring documents in a query. *Variables* diff --git a/docs/painless/painless-contexts/painless-sort-context.asciidoc b/docs/painless/painless-contexts/painless-sort-context.asciidoc index 7f510fb6a9251..9efd507668839 100644 --- a/docs/painless/painless-contexts/painless-sort-context.asciidoc +++ b/docs/painless/painless-contexts/painless-sort-context.asciidoc @@ -2,7 +2,7 @@ === Sort context Use a Painless script to -{es_version}/search-request-sort.html[sort] the documents in a query. +{ref}/search-request-sort.html[sort] the documents in a query. *Variables* diff --git a/docs/painless/painless-contexts/painless-update-by-query-context.asciidoc b/docs/painless/painless-contexts/painless-update-by-query-context.asciidoc index 65666e15844bf..d8d7754807496 100644 --- a/docs/painless/painless-contexts/painless-update-by-query-context.asciidoc +++ b/docs/painless/painless-contexts/painless-update-by-query-context.asciidoc @@ -2,7 +2,7 @@ === Update by query context Use a Painless script in an -{es_version}/docs-update-by-query.html[update by query] operation to add, +{ref}/docs-update-by-query.html[update by query] operation to add, modify, or delete fields within each of a set of documents collected as the result of query. @@ -14,22 +14,22 @@ result of query. `ctx['_op']` (`String`):: The name of the operation. -{es_version}/mapping-routing-field.html[`ctx['_routing']`] (`String`, read-only):: +{ref}/mapping-routing-field.html[`ctx['_routing']`] (`String`, read-only):: The value used to select a shard for document storage. -{es_version}/mapping-index-field.html[`ctx['_index']`] (`String`, read-only):: +{ref}/mapping-index-field.html[`ctx['_index']`] (`String`, read-only):: The name of the index. -{es_version}/mapping-type-field.html[`ctx['_type']`] (`String`, read-only):: +{ref}/mapping-type-field.html[`ctx['_type']`] (`String`, read-only):: The type of document within an index. -{es_version}/mapping-id-field.html[`ctx['_id']`] (`int`, read-only):: +{ref}/mapping-id-field.html[`ctx['_id']`] (`int`, read-only):: The unique document id. `ctx['_version']` (`int`, read-only):: The current version of the document. -{es_version}/mapping-source-field.html[`ctx['_source']`] (`Map`):: +{ref}/mapping-source-field.html[`ctx['_source']`] (`Map`):: Contains extracted JSON in a `Map` and `List` structure for the fields existing in a stored document. @@ -40,7 +40,7 @@ result of query. specify no operation or `delete` to delete the current document from the index. -{es_version}/mapping-source-field.html[`ctx['_source']`]:: +{ref}/mapping-source-field.html[`ctx['_source']`]:: Modify the values in the `Map/List` structure to add, modify, or delete the fields of a document. diff --git a/docs/painless/painless-contexts/painless-update-context.asciidoc b/docs/painless/painless-contexts/painless-update-context.asciidoc index b04ba8d9ffb56..d1b4b84eb187a 100644 --- a/docs/painless/painless-contexts/painless-update-context.asciidoc +++ b/docs/painless/painless-contexts/painless-update-context.asciidoc @@ -1,7 +1,7 @@ [[painless-update-context]] === Update context -Use a Painless script in an {es_version}/docs-update.html[update] operation to +Use a Painless script in an {ref}/docs-update.html[update] operation to add, modify, or delete fields within a single document. *Variables* @@ -12,16 +12,16 @@ add, modify, or delete fields within a single document. `ctx['_op']` (`String`):: The name of the operation. -{es_version}/mapping-routing-field.html[`ctx['_routing']`] (`String`, read-only):: +{ref}/mapping-routing-field.html[`ctx['_routing']`] (`String`, read-only):: The value used to select a shard for document storage. -{es_version}/mapping-index-field.html[`ctx['_index']`] (`String`, read-only):: +{ref}/mapping-index-field.html[`ctx['_index']`] (`String`, read-only):: The name of the index. -{es_version}/mapping-type-field.html[`ctx['_type']`] (`String`, read-only):: +{ref}/mapping-type-field.html[`ctx['_type']`] (`String`, read-only):: The type of document within an index. -{es_version}/mapping-id-field.html[`ctx['_id']`] (`int`, read-only):: +{ref}/mapping-id-field.html[`ctx['_id']`] (`int`, read-only):: The unique document id. `ctx['_version']` (`int`, read-only):: @@ -30,7 +30,7 @@ add, modify, or delete fields within a single document. `ctx['_now']` (`long`, read-only):: The current timestamp in milliseconds. -{es_version}/mapping-source-field.html[`ctx['_source']`] (`Map`):: +{ref}/mapping-source-field.html[`ctx['_source']`] (`Map`):: Contains extracted JSON in a `Map` and `List` structure for the fields existing in a stored document. @@ -41,7 +41,7 @@ add, modify, or delete fields within a single document. specify no operation or `delete` to delete the current document from the index. -{es_version}/mapping-source-field.html[`ctx['_source']`]:: +{ref}/mapping-source-field.html[`ctx['_source']`]:: Modify the values in the `Map/List` structure to add, modify, or delete the fields of a document. diff --git a/docs/painless/painless-contexts/painless-watcher-condition-context.asciidoc b/docs/painless/painless-contexts/painless-watcher-condition-context.asciidoc index 3a5e460a55de7..26efe24ae07b3 100644 --- a/docs/painless/painless-contexts/painless-watcher-condition-context.asciidoc +++ b/docs/painless/painless-contexts/painless-watcher-condition-context.asciidoc @@ -1,7 +1,7 @@ [[painless-watcher-condition-context]] === Watcher condition context -Use a Painless script as a {xp_version}/condition-script.html[watcher condition] +Use a Painless script as a {xpack-ref}/condition-script.html[watcher condition] to test if a response is necessary. *Variables* @@ -26,7 +26,7 @@ to test if a response is necessary. `ctx['payload']` (`Map`, read-only):: The accessible watch data based upon the - {xp_version}/input.html[watch input]. + {xpack-ref}/input.html[watch input]. *Return* diff --git a/docs/painless/painless-contexts/painless-watcher-transform-context.asciidoc b/docs/painless/painless-contexts/painless-watcher-transform-context.asciidoc index 1831da5a9f87b..9296fdda1c1f2 100644 --- a/docs/painless/painless-contexts/painless-watcher-transform-context.asciidoc +++ b/docs/painless/painless-contexts/painless-watcher-transform-context.asciidoc @@ -1,7 +1,7 @@ [[painless-watcher-transform-context]] === Watcher transform context -Use a Painless script to {xp_version}/transform-script.html[transform] watch +Use a Painless script to {xpack-ref}/transform-script.html[transform] watch data into a new payload for use in a response to a condition. *Variables* @@ -26,7 +26,7 @@ data into a new payload for use in a response to a condition. `ctx['payload']` (`Map`, read-only):: The accessible watch data based upon the - {xp_version}/input.html[watch input]. + {xpack-ref}/input.html[watch input]. *Return* diff --git a/docs/painless/painless-contexts/painless-weight-context.asciidoc b/docs/painless/painless-contexts/painless-weight-context.asciidoc index 0aef936183c0f..ad215d5386b05 100644 --- a/docs/painless/painless-contexts/painless-weight-context.asciidoc +++ b/docs/painless/painless-contexts/painless-weight-context.asciidoc @@ -2,7 +2,7 @@ === Weight context Use a Painless script to create a -{es_version}/index-modules-similarity.html[weight] for use in a +{ref}/index-modules-similarity.html[weight] for use in a <>. Weight is used to prevent recalculation of constants that remain the same across documents.