\Elastica\AggregationDateHistogram

Class DateHistogram.

Summary

Methods
Properties
Constants
__construct()
setInterval()
setOrder()
setMinimumDocumentCount()
setField()
setScript()
toArray()
setTimezone()
setFactor()
setOffset()
setFormat()
setExtendedBounds()
No public properties found
DEFAULT_TIMEZONE_VALUE
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

DEFAULT_TIMEZONE_VALUE

DEFAULT_TIMEZONE_VALUE

Methods

__construct()

__construct(string  $name, string  $field, integer|string  $interval) 

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

setInterval()

setInterval(integer|string  $interval) : $this

Set the interval by which documents will be bucketed.

Parameters

integer|string $interval

Returns

$this

setOrder()

setOrder(string  $order, string  $direction) : $this

Set the bucket sort order.

Parameters

string $order

"_count", "_term", or the name of a sub-aggregation or sub-aggregation response field

string $direction

"asc" or "desc"

Returns

$this

setMinimumDocumentCount()

setMinimumDocumentCount(integer  $count) : $this

Set the minimum number of documents which must fall into a bucket in order for the bucket to be returned.

Parameters

integer $count

set to 0 to include empty buckets

Returns

$this

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}

setTimezone()

setTimezone(string  $timezone) : $this

Set time_zone option.

Parameters

string $timezone

Returns

$this

setFactor()

setFactor(integer  $factor) : $this

Adjust for granularity of date data.

Parameters

integer $factor

set to 1000 if date is stored in seconds rather than milliseconds

Returns

$this

setOffset()

setOffset(string  $offset) : $this

Set offset option.

Parameters

string $offset

Returns

$this

setFormat()

setFormat(string  $format) : $this

Set the format for returned bucket key_as_string values.

Parameters

string $format

see link for formatting options

Returns

$this

setExtendedBounds()

setExtendedBounds(string  $min = '', string  $max = '') : $this

Set extended bounds option.

Parameters

string $min

see link for formatting options

string $max

see link for formatting options

Returns

$this