Skip to content

Commit

Permalink
Update scripted-metric-aggregation.asciidoc (elastic#101899) (elastic…
Browse files Browse the repository at this point in the history
…#102411)

Co-authored-by: Venkata Krishnan <[email protected]>
  • Loading branch information
abdonpijpelink and pernelkanic authored Nov 21, 2023
1 parent 5de0832 commit 575852e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ init_script:: Executed prior to any collection of documents. Allows the ag
+
In the above example, the `init_script` creates an array `transactions` in the `state` object.

map_script:: Executed once per document collected. This is a required script. If no combine_script is specified, the resulting state
needs to be stored in the `state` object.
map_script:: Executed once per document collected. This is a required script.
+
In the above example, the `map_script` checks the value of the type field. If the value is 'sale' the value of the amount field
is added to the transactions array. If the value of the type field is not 'sale' the negated value of the amount field is added
Expand Down

0 comments on commit 575852e

Please sign in to comment.