\Elastica\QueryBuilder\DSLAggregation

elasticsearch aggregation DSL.

Summary

Methods
Properties
Constants
getType()
min()
max()
sum()
avg()
stats()
extended_stats()
value_count()
percentiles()
percentile_ranks()
cardinality()
geo_bounds()
top_hits()
scripted_metric()
global_agg()
filter()
filters()
missing()
nested()
reverse_nested()
children()
terms()
significant_terms()
range()
date_range()
ipv4_range()
histogram()
date_histogram()
geo_distance()
geohash_grid()
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

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

avg()

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

avg aggregation.

Parameters

string $name

Returns

\Elastica\Aggregation\Avg

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  $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 $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