[DOCS] Clarify behaviour of scripted-metric arg with empty parent buckets

This commit is contained in:
Colin Goodheart-Smithe 2017-06-02 11:00:27 +01:00
parent 018c6c38fe
commit 5e7a79636d
No known key found for this signature in database
GPG Key ID: 876C3A617D8EA73A

View File

@ -278,3 +278,9 @@ params:: Optional. An object whose contents will be passed as variable
"_agg" : {}
}
--------------------------------------------------
==== Empty Buckets
If a parent bucket of the scripted metric aggregation does not collect any documents an empty aggregation response will be returned from the
shard with a `null` value. In this case the `reduce_script`'s `_aggs` variable will contain `null` as a response from that shard.
`reduce_script`'s should therefore expect and deal with `null` responses from shards.