include/SugarSearchEngine/Elastic/Elastica/Facet/DateHistogram.php

Show: inherited
Table of Contents

Implements the Date Histogram facet.

Author
Raul Martinez Jr  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/search/facets/date-histogram-facet.html  
Link
https://github.com/elasticsearch/elasticsearch/issues/591  
Package
Elastica  

\Elastica_Facet_DateHistogram

Package: Elastica

Implements the Date Histogram facet.

This function can be used to handle params for queries, filter, facets

Parent(s)
\Elastica_Facet_Histogram < \Elastica_Facet_Abstract < \Elastica_Param
Author
Raul Martinez Jr  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/search/facets/date-histogram-facet.html  
Link
https://github.com/elasticsearch/elasticsearch/issues/591  

Properties

Propertyprotectedarray  $_facet= 'array()'
inherited

Holds all facet parameters.

Inherited from: \Elastica_Facet_Abstract::$$_facet\Elastica_Facet_Histogram::$$_facet
Default valuearray()Details
Type
array
Inherited_from
\Elastica_Facet_Abstract::$$_facet  
Inherited_from
\Elastica_Facet_Histogram::$$_facet  
Propertyprotectedstring  $_name= ''''
inherited

Holds the name of the facet.

Inherited from: \Elastica_Facet_Abstract::$$_name\Elastica_Facet_Histogram::$$_name
Default value''Details
Type
string
Inherited_from
\Elastica_Facet_Abstract::$$_name  
Inherited_from
\Elastica_Facet_Histogram::$$_name  
Propertyprotectedarray  $_params= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\Elastica_Param::$$_params  
Inherited_from
\Elastica_Facet_Abstract::$$_params  
Inherited_from
\Elastica_Facet_Histogram::$$_params  
Propertyprotected  $_rawParams= 'array()'
Default valuearray()Details
Type
n/a
Inherited_from
\Elastica_Param::$$_rawParams  
Inherited_from
\Elastica_Facet_Abstract::$$_rawParams  
Inherited_from
\Elastica_Facet_Histogram::$$_rawParams  

Methods

methodpublic__construct( string $name ) : void
inherited

Constructs a Facet object.

Inherited from: \Elastica_Facet_Abstract::__construct()\Elastica_Facet_Histogram::__construct()
Parameters
Name Type Description
$name string

The name of the facet.

methodprotected_setFacetParam( string $key, mixed $value ) : \Elastica_Facet_Abstract
inherited

Sets a param for the facet. Each facet implementation needs to take care of handling their own params.

Inherited from: \Elastica_Facet_Abstract::_setFacetParam()\Elastica_Facet_Histogram::_setFacetParam()
Parameters
Name Type Description
$key string

The key of the param to set.

$value mixed

The value of the param.

Returns
Type Description
\Elastica_Facet_Abstract
methodprotected_setRawParam( string $key, mixed $value ) : \Elastica_Param
Parameters
Name Type Description
$key string
$value mixed
Returns
Type Description
\Elastica_Param
methodpublicaddParam( string $key, mixed $value ) : \Elastica_Param

This function can be used to add an array of params

Parameters
Name Type Description
$key string

Param key

$value mixed

Value to set

Returns
Type Description
\Elastica_Param
methodpublicgetName( ) : string
inherited

Gets the name of the facet.

Inherited from: \Elastica_Facet_Abstract::getName()\Elastica_Facet_Histogram::getName()
Returns
Type Description
string
methodpublicgetParam( string $key ) : mixed
Parameters
Name Type Description
$key string

Key to return

Returns
Type Description
mixed Key value
Throws
Exception Description
\Elastica_Exception_Invalid If requested key is not set
methodpublicgetParams( ) : array
Returns
Type Description
array Params
methodpublicsetField( string $field ) : \Elastica_Facet_Histogram
inherited

Sets the field for histogram

Inherited from: \Elastica_Facet_Histogram::setField()
Parameters
Name Type Description
$field string

The name of the field for the historgram

Returns
Type Description
\Elastica_Facet_Histogram
methodpublicsetFilter( \Elastica_Filter_Abstract $filter ) : \Elastica_Facet_Abstract
inherited

Sets a filter for this facet.

Inherited from: \Elastica_Facet_Abstract::setFilter()\Elastica_Facet_Histogram::setFilter()
Parameters
Name Type Description
$filter \Elastica_Filter_Abstract

A filter to apply on the facet.

Returns
Type Description
\Elastica_Facet_Abstract
methodpublicsetGlobal( bool $global = true ) : \Elastica_Facet_Abstract
inherited

Sets the flag to either run the facet globally or bound to the current search query. When not set, it defaults to the ElasticSearch default value.

Inherited from: \Elastica_Facet_Abstract::setGlobal()\Elastica_Facet_Histogram::setGlobal()
Parameters
Name Type Description
$global bool

Flag to either run the facet globally.

Returns
Type Description
\Elastica_Facet_Abstract
methodpublicsetInterval( string $interval ) : \Elastica_Facet_Range
inherited

Set the value for interval

Inherited from: \Elastica_Facet_Histogram::setInterval()
Parameters
Name Type Description
$interval string
Returns
Type Description
\Elastica_Facet_Range
methodpublicsetKeyValueFields( string $keyField, string $valueField ) : \Elastica_Facet_Range
inherited

Set the fields for key_field and value_field

Inherited from: \Elastica_Facet_Histogram::setKeyValueFields()
Parameters
Name Type Description
$keyField string

Key field

$valueField string

Value field

Returns
Type Description
\Elastica_Facet_Range
methodpublicsetKeyValueScripts( string $keyScript, string $valueScript ) : void
inherited

Sets the key and value for this facet by script.

Inherited from: \Elastica_Facet_Histogram::setKeyValueScripts()
Parameters
Name Type Description
$keyScript string

Script to check whether it falls into the range.

$valueScript string

Script to use for statistical calculations.

methodpublicsetName( string $name ) : \Elastica_Facet_Abstract
inherited

Sets the name of the facet. It is automatically set by the constructor.

Inherited from: \Elastica_Facet_Abstract::setName()\Elastica_Facet_Histogram::setName()
Parameters
Name Type Description
$name string

The name of the facet.

Returns
Type Description
\Elastica_Facet_Abstract
Throws
Exception Description
\Elastica_Exception_Invalid
methodpublicsetParam( string $key, mixed $value ) : void
inherited

Sets (overwrites) the value at the given key

Inherited from: \Elastica_Param::setParam()\Elastica_Facet_Abstract::setParam()\Elastica_Facet_Histogram::setParam()
Parameters
Name Type Description
$key string

Key to set

$value mixed

Key Value

methodpublicsetParams( array $params ) : \Elastica_Param
inherited

Sets (overwrites) all params of this object

Inherited from: \Elastica_Param::setParams()\Elastica_Facet_Abstract::setParams()\Elastica_Facet_Histogram::setParams()
Parameters
Name Type Description
$params array

Parameter list

Returns
Type Description
\Elastica_Param
methodpublicsetScriptParams( array $params ) : \Elastica_Facet_Histogram
inherited

Set the "params" essential to the a script

Inherited from: \Elastica_Facet_Histogram::setScriptParams()
Parameters
Name Type Description
$params array

Associative array (key/value pair)

Returns
Type Description
\Elastica_Facet_Histogram Facet object
methodpublicsetTimezone( string $tzOffset ) : void

Set the time_zone parameter

Parameters
Name Type Description
$tzOffset string
methodpublictoArray( ) : array

Creates the full facet definition, which includes the basic facet definition of the parent.

Returns
Type Description
array
Throws
Exception Description
\Elastica_Exception_Invalid When the right fields haven't been set.
Details
See
\Elastica_Facet_Abstract::toArray()  
Documentation was generated by DocBlox 0.18.1.