Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Painless context doc updates for scripted metric aggregation "state" context variables #32695

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ optional as part of a full metric aggregation.
`params` (`Map`, read-only)::
User-defined parameters passed in as part of the query.

`params['_agg']` (`Map`)::
`state` (`Map`)::
`Map` with values available from the prior map script.

*Return*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ full metric aggregation.
`params` (`Map`, read-only)::
User-defined parameters passed in as part of the query.

`params['_agg']` (`Map`)::
`state` (`Map`)::
Empty `Map` used to add values for use in a
<<painless-metric-agg-map-context, map script>>.

*Side Effects*

`params['_agg']` (`Map`)::
`state` (`Map`)::
Add values to this `Map` to for use in a map. Additional values must
be of the type `Map`, `List`, `String` or primitive.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ part of a full metric aggregation.
`params` (`Map`, read-only)::
User-defined parameters passed in as part of the query.

`params['_agg']` (`Map`)::
`state` (`Map`)::
`Map` used to add values for processing in a
<<painless-metric-agg-map-context, combine script>> or returned
directly.
<<painless-metric-agg-map-context, combine script>> or to be returned from the aggregation.

`doc` (`Map`, read-only)::
Contains the fields of the current document where each field is a
Expand All @@ -27,15 +26,16 @@ part of a full metric aggregation.

*Side Effects*

`params['_agg']` (`Map`)::
`state` (`Map`)::
Use this `Map` to add values for processing in a combine script.
Additional values must be of the type `Map`, `List`, `String` or
primitive. If an initialization script is provided as part the
primitive. The same `state` `Map` is shared between all aggregated documents
on a given shard. If an initialization script is provided as part of the
aggregation then values added from the initialization script are
available as well. If no combine script is specified, values must be
directly stored in `_agg`. If no combine script and no
available. If no combine script is specified, values must be
directly stored in `state` in a usable form. If no combine script and no
<<painless-metric-agg-reduce-context, reduce script>> are specified, the
values are used as the result.
`state` values are used as the result.

*Return*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ specified) and is optional as part of a full metric aggregation.
`params` (`Map`, read-only)::
User-defined parameters passed in as part of the query.

`params['_aggs']` (`Map`)::
`states` (`Map`)::
`Map` with values available from the prior combine script (or a map
script if no combine script is specified).

Expand Down