\Elastica\AggregationRange

Class Range.

Summary

Methods
Properties
Constants
setField()
setScript()
toArray()
addRange()
setKeyedResponse()
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

setField()

setField(string  $field) : $this

Set the field for this aggregation.

Parameters

string $field

the name of the document field on which to perform this aggregation

Returns

$this

setScript()

setScript(string|\Elastica\Script\AbstractScript  $script) : $this

Set a script for this aggregation.

Parameters

string|\Elastica\Script\AbstractScript $script

Returns

$this

toArray()

toArray() 

{@inheritdoc}

addRange()

addRange(integer|float  $fromValue = null, integer|float  $toValue = null, string  $key = null) : $this

Add a range to this aggregation.

Parameters

integer|float $fromValue

low end of this range, exclusive (greater than or equal to)

integer|float $toValue

high end of this range, exclusive (less than)

string $key

customized key value

Throws

\Elastica\Exception\InvalidException

Returns

$this

setKeyedResponse()

setKeyedResponse(boolean  $keyed = true) : $this

If set to true, a unique string key will be associated with each bucket, and ranges will be returned as an associative array.

Parameters

boolean $keyed

Returns

$this