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

Show: inherited
Table of Contents

Implements the range facet.

Author
Jasper van Wanrooy  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/search/facets/range-facet.html  
Package
Elastica  

\Elastica_Facet_Range

Package: Elastica

Implements the range facet.

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

Parent(s)
\Elastica_Facet_Abstract < \Elastica_Param
Author
Jasper van Wanrooy  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/search/facets/range-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
methodpublicaddRange( mixed $from = null, mixed $to = null ) : \Elastica_Facet_Range

Adds a range to the range facet.

Parameters
Name Type Description
$from mixed

The from for the range.

$to mixed

The to for the range.

Returns
Type Description
\Elastica_Facet_Range
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_Range

Sets the field for the range.

Parameters
Name Type Description
$field string

The name of the field for range.

Returns
Type Description
\Elastica_Facet_Range
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
methodpublicsetKeyValueFields( string $keyField, string $valueField ) : \Elastica_Facet_Range

Sets the fields by their separate key and value fields.

Parameters
Name Type Description
$keyField string

The key_field param for the range.

$valueField string

The key_value param for the range.

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
methodpublicsetRanges( array $ranges ) : \Elastica_Facet_Range

Sets the ranges for the facet all at once. Sample ranges: array ( array('to' => 50), array('from' => 20, 'to' 70), array('from' => 70, 'to' => 120), array('from' => 150) )

Parameters
Name Type Description
$ranges array

Numerical array with range definitions.

Returns
Type Description
\Elastica_Facet_Range
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.