Methods

getType()

getType() : string

must return type for QueryBuilder usage.

Returns

string

min()

min(string  $name) : \Elastica\Aggregation\Min

min aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Min

max()

max(string  $name) : \Elastica\Aggregation\Max

max aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Max

sum()

sum(string  $name) : \Elastica\Aggregation\Sum

sum aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Sum

sum_bucket()

sum_bucket(string  $name, string|null  $bucketsPath = null) : \Elastica\Aggregation\SumBucket

sum bucket aggregation.

Parameters

string $name
string|null $bucketsPath

Returns

\Elastica\Aggregation\SumBucket

avg()

avg(string  $name) : \Elastica\Aggregation\Avg

avg aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Avg

avg_bucket()

avg_bucket(string  $name, string|null  $bucketsPath = null) : \Elastica\Aggregation\AvgBucket

avg bucket aggregation.

Parameters

string $name
string|null $bucketsPath

Returns

\Elastica\Aggregation\AvgBucket

stats()

stats(string  $name) : \Elastica\Aggregation\Stats

stats aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Stats

extended_stats()

extended_stats(string  $name) : \Elastica\Aggregation\ExtendedStats

extended stats aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\ExtendedStats

value_count()

value_count(string  $name, string  $field) : \Elastica\Aggregation\ValueCount

value count aggregation.

Parameters

string $name
string $field

Returns

\Elastica\Aggregation\ValueCount

percentiles()

percentiles(string  $name, string  $field = null) : \Elastica\Aggregation\Percentiles

percentiles aggregation.

Parameters

string $name

the name of this aggregation

string $field

the field on which to perform this aggregation

Returns

\Elastica\Aggregation\Percentiles

percentile_ranks()

percentile_ranks(string  $name) 

percentile ranks aggregation.

Parameters

string $name

cardinality()

cardinality(string  $name) : \Elastica\Aggregation\Cardinality

cardinality aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Cardinality

geo_bounds()

geo_bounds(string  $name) 

geo bounds aggregation.

Parameters

string $name

top_hits()

top_hits(string  $name) : \Elastica\Aggregation\TopHits

top hits aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\TopHits

scripted_metric()

scripted_metric(string  $name, string|null  $initScript = null, string|null  $mapScript = null, string|null  $combineScript = null, string|null  $reduceScript = null) : \Elastica\Aggregation\ScriptedMetric

scripted metric aggregation.

Parameters

string $name
string|null $initScript
string|null $mapScript
string|null $combineScript
string|null $reduceScript

Returns

\Elastica\Aggregation\ScriptedMetric

filters()

filters(string  $name) : \Elastica\Aggregation\Filters

filters aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Filters

missing()

missing(string  $name, string  $field) : \Elastica\Aggregation\Missing

missing aggregation.

Parameters

string $name
string $field

Returns

\Elastica\Aggregation\Missing

nested()

nested(string  $name, string  $path) : \Elastica\Aggregation\Nested

nested aggregation.

Parameters

string $name
string $path

the nested path for this aggregation

Returns

\Elastica\Aggregation\Nested

reverse_nested()

reverse_nested(string  $name, string  $path = null) : \Elastica\Aggregation\ReverseNested

reverse nested aggregation.

Parameters

string $name

The name of this aggregation

string $path

Optional path to the nested object for this aggregation. Defaults to the root of the main document.

Returns

\Elastica\Aggregation\ReverseNested

children()

children(string  $name) 

children aggregation.

Parameters

string $name

terms()

terms(string  $name) : \Elastica\Aggregation\Terms

terms aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Terms

significant_terms()

significant_terms(string  $name) : \Elastica\Aggregation\SignificantTerms

significant terms aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\SignificantTerms

range()

range(string  $name) : \Elastica\Aggregation\Range

range aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Range

date_range()

date_range(string  $name) : \Elastica\Aggregation\DateRange

date range aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\DateRange

ipv4_range()

ipv4_range(string  $name, string  $field) : \Elastica\Aggregation\IpRange

ipv4 range aggregation.

Parameters

string $name
string $field

Returns

\Elastica\Aggregation\IpRange

histogram()

histogram(string  $name, string  $field, integer  $interval) : \Elastica\Aggregation\Histogram

histogram aggregation.

Parameters

string $name

the name of this aggregation

string $field

the name of the field on which to perform the aggregation

integer $interval

the interval by which documents will be bucketed

Returns

\Elastica\Aggregation\Histogram

date_histogram()

date_histogram(string  $name, string  $field, integer|string  $interval) : \Elastica\Aggregation\DateHistogram

date histogram aggregation.

Parameters

string $name

the name of this aggregation

string $field

the name of the field on which to perform the aggregation

integer|string $interval

the interval by which documents will be bucketed

Returns

\Elastica\Aggregation\DateHistogram

geo_distance()

geo_distance(string  $name, string  $field, string|array  $origin) : \Elastica\Aggregation\GeoDistance

geo distance aggregation.

Parameters

string $name

the name if this aggregation

string $field

the field on which to perform this aggregation

string|array $origin

the point from which distances will be calculated

Returns

\Elastica\Aggregation\GeoDistance

geohash_grid()

geohash_grid(string  $name, string  $field) : \Elastica\Aggregation\GeohashGrid

geohash grid aggregation.

Parameters

string $name

the name of this aggregation

string $field

the field on which to perform this aggregation

Returns

\Elastica\Aggregation\GeohashGrid

bucket_script()

bucket_script(string  $name, array|null  $bucketsPath = null, string|null  $script = null) : \Elastica\Aggregation\BucketScript

bucket script aggregation.

Parameters

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

Returns

\Elastica\Aggregation\BucketScript

serial_diff()

serial_diff(string  $name, string|null  $bucketsPath = null) : \Elastica\Aggregation\SerialDiff

serial diff aggregation.

Parameters

string $name
string|null $bucketsPath

Returns

\Elastica\Aggregation\SerialDiff

adjacency_matrix()

adjacency_matrix(string  $name) : \Elastica\Aggregation\AdjacencyMatrix

adjacency matrix aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\AdjacencyMatrix