class Aggregation

Aggregation represents a data aggregation method.

Use one of the static methods count, sum, lastValue or distribution to construct an Aggregation.

Constants

NONE

No or unknown Aggregation type.

COUNT

Count Aggregation type.

SUM

Sum Aggregation type.

DISTRIBUTION

Distribution Aggregation type.

LAST_VALUE

LastValue Aggregation type.

Methods

int
getType()

Returns the type of the aggregation.

array
getBucketBoundaries()

Returns the bucket boundaries of the Distribution Aggregation.

static Aggregation
count()

Returns a new Count Aggregation

static Aggregation
distribution(array $bounds)

Returns a new Distribution Aggregation with the provided Bucket Boundaries.

static Aggregation
lastValue()

Returns a new LastValue Aggregation.

static Aggregation
sum()

Returns a new Sum Aggregation.

Details

at line 58
final int getType()

Returns the type of the aggregation.

Return Value

int The Aggregation Type.

at line 68
final array getBucketBoundaries()

Returns the bucket boundaries of the Distribution Aggregation.

Return Value

array Returns the bucket boundaries.

at line 81
final static Aggregation count()

Returns a new Count Aggregation

Return Value

Aggregation

at line 94
final static Aggregation distribution(array $bounds)

Returns a new Distribution Aggregation with the provided Bucket Boundaries.

Bucket Boundaries needs to be an array of integer and/or floats.

Parameters

array $bounds The bucket boundaries for distribution aggregation.

Return Value

Aggregation

Exceptions

Exception Throws on invalid bucket boundaries.

at line 112
final static Aggregation lastValue()

Returns a new LastValue Aggregation.

Return Value

Aggregation

at line 122
final static Aggregation sum()

Returns a new Sum Aggregation.

Return Value

Aggregation