Skip to content

Commit

Permalink
Update scripted metric docs to use state variable (#32695)
Browse files Browse the repository at this point in the history
This change brings the scripted metric agg context docs in line with the new agg state context variable.
  • Loading branch information
rationull authored and rjernst committed Aug 10, 2018
1 parent 1ad1ff9 commit 19c84b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
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

0 comments on commit 19c84b9

Please sign in to comment.