You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lets say that documents 1 and 3 end up on shard A and documents 2 and 4 end up on shard B. The following is a breakdown of what the aggregation result is
166
+
Lets say that documents 1 and 3 end up on shard A and documents 2 and 4 end up on shard B. The following is a breakdown of what the aggregation result is
157
167
at each stage of the example above.
158
168
159
169
===== Before init_script
@@ -221,7 +231,7 @@ Shard B::
221
231
222
232
===== After combine_script
223
233
224
-
The combine_script is executed on each shard after document collection is complete and reduces all the transactions down to a single profit figure for each
234
+
The combine_script is executed on each shard after document collection is complete and reduces all the transactions down to a single profit figure for each
225
235
shard (by summing the values in the transactions array) which is passed back to the coordinating node:
226
236
227
237
Shard A:: 50
@@ -239,7 +249,7 @@ The reduce_script receives an `_aggs` array containing the result of the combine
It reduces the responses for the shards down to a final overall profit figure (by summing the values) and returns this as the result of the aggregation to
252
+
It reduces the responses for the shards down to a final overall profit figure (by summing the values) and returns this as the result of the aggregation to
243
253
produce the response:
244
254
245
255
[source,js]
@@ -258,8 +268,8 @@ produce the response:
258
268
==== Other Parameters
259
269
260
270
[horizontal]
261
-
params:: Optional. An object whose contents will be passed as variables to the `init_script`, `map_script` and `combine_script`. This can be
262
-
useful to allow the user to control the behavior of the aggregation and for storing state between the scripts. If this is not specified,
271
+
params:: Optional. An object whose contents will be passed as variables to the `init_script`, `map_script` and `combine_script`. This can be
272
+
useful to allow the user to control the behavior of the aggregation and for storing state between the scripts. If this is not specified,
263
273
the default is the equivalent of providing:
264
274
+
265
275
[source,js]
@@ -268,4 +278,3 @@ params:: Optional. An object whose contents will be passed as variable
0 commit comments