\Elastica\AggregationBucketScript

Class BucketScript.

Summary

Methods
Properties
Constants
__construct()
setBucketsPath()
setScript()
setGapPolicy()
setFormat()
toArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string  $name, array|null  $bucketsPath = null, string|null  $script = null) 

Parameters

string $name
array|null $bucketsPath
string|null $script

setBucketsPath()

setBucketsPath(array  $bucketsPath) : $this

Set the buckets_path for this aggregation.

Parameters

array $bucketsPath

Returns

$this

setScript()

setScript(string  $script) : $this

Set the script for this aggregation.

Parameters

string $script

Returns

$this

setGapPolicy()

setGapPolicy(string  $gapPolicy = 'skip') : $this

Set the gap policy for this aggregation.

Parameters

string $gapPolicy

Returns

$this

setFormat()

setFormat(string|null  $format = null) : $this

Set the format for this aggregation.

Parameters

string|null $format

Returns

$this

toArray()

toArray() : array

Throws

\Elastica\Exception\InvalidException

If buckets path or script is not set

Returns

array