$_name : string
This function can be used to handle params for queries, filter
__construct(string $name, string|null $initScript = null, string|null $mapScript = null, string|null $combineScript = null, string|null $reduceScript = null)
the name if this aggregation
Executed prior to any collection of documents
Executed once per document collected
Executed once on each shard after document collection is complete
Executed once on the coordinating node after all shards have returned their results
addAggregation(\Elastica\Aggregation\AbstractAggregation $aggregation) : $this
Add a sub-aggregation.
setCombineScript(string $script) : $this
Executed once on each shard after document collection is complete.
Allows the aggregation to consolidate the state returned from each shard. If a combine_script is not provided the combine phase will return the aggregation variable.
setReduceScript(string $script) : $this
Executed once on the coordinating node after all shards have returned their results.
The script is provided with access to a variable _aggs which is an array of the result of the combine_script on each shard. If a reduce_script is not provided the reduce phase will return the _aggs variable.