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

Show: inherited
Table of Contents

Implements the Histogram facet.

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

\Elastica_Facet_Histogram

Package: Elastica

Implements the Histogram facet.

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

Parent(s)
\Elastica_Facet_Abstract < \Elastica_Param
Children
\Elastica_Facet_DateHistogram
Author
Raul Martinez Jr  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html  

Properties

Propertyprotectedarray  $_facet= 'array()'
inherited

Holds all facet parameters.

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

Holds the name of the facet.

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

Methods

methodpublic__construct( string $name ) : void
inherited

Constructs a Facet object.

Inherited from: \Elastica_Facet_Abstract::__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()
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
inherited

Sets params not inside params array

Inherited from: \Elastica_Param::_setRawParam()\Elastica_Facet_Abstract::_setRawParam()
Parameters
Name Type Description
$key string
$value mixed
Returns
Type Description
\Elastica_Param
methodpublicaddParam( string $key, mixed $value ) : \Elastica_Param
inherited

Adds a param to the list

Inherited from: \Elastica_Param::addParam()\Elastica_Facet_Abstract::addParam()

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()
Returns
Type Description
string
methodpublicgetParam( string $key ) : mixed
inherited

Returns a specific param

Inherited from: \Elastica_Param::getParam()\Elastica_Facet_Abstract::getParam()
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
inherited

Returns the params array

Inherited from: \Elastica_Param::getParams()\Elastica_Facet_Abstract::getParams()
Returns
Type Description
array Params
methodpublicsetField( string $field ) : \Elastica_Facet_Histogram

Sets the field for histogram

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()
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()
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

Set the value for interval

Parameters
Name Type Description
$interval string
Returns
Type Description
\Elastica_Facet_Range
methodpublicsetKeyValueFields( string $keyField, string $valueField ) : \Elastica_Facet_Range

Set the fields for key_field and value_field

Parameters
Name Type Description
$keyField string

Key field

$valueField string

Value field

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

Sets the key and value for this facet by script.

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()
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()
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()
Parameters
Name Type Description
$params array

Parameter list

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

Set the "params" essential to the a script

Parameters
Name Type Description
$params array

Associative array (key/value pair)

Returns
Type Description
\Elastica_Facet_Histogram Facet object
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.