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

Show: inherited
Table of Contents

Abstract facet object. Should be extended by all facet types

Author
Nicolas Ruflin  
Author
Jasper van Wanrooy  
Category
Xodoa  
Package
Elastica  

\Elastica_Facet_Abstract

Package: Elastica

Abstract facet object. Should be extended by all facet types

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

Parent(s)
\Elastica_Param
Children
\Elastica_Facet_Range
\Elastica_Facet_Terms
\Elastica_Facet_Histogram
Author
Nicolas Ruflin  
Author
Jasper van Wanrooy  
Category
Xodoa  

Properties

Propertyprotectedarray  $_facet= 'array()'

Holds all facet parameters.

Default valuearray()Details
Type
array
Propertyprotectedstring  $_name= ''''

Holds the name of the facet.

Default value''Details
Type
string
Propertyprotectedarray  $_params= 'array()'
inherited

Params

Inherited from: \Elastica_Param::$$_params
Default valuearray()Details
Type
array
Inherited_from
\Elastica_Param::$$_params  
Propertyprotected  $_rawParams= 'array()'
inheritedInherited from: \Elastica_Param::$$_rawParams
Default valuearray()Details
Type
n/a
Inherited_from
\Elastica_Param::$$_rawParams  

Methods

methodpublic__construct( string $name ) : void

Constructs a Facet object.

Parameters
Name Type Description
$name string

The name of the facet.

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

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

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

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

Gets the name of the facet.

Returns
Type Description
string
methodpublicgetParam( string $key ) : mixed
inherited

Returns a specific param

Inherited from: \Elastica_Param::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()
Returns
Type Description
array Params
methodpublicsetFilter( \Elastica_Filter_Abstract $filter ) : \Elastica_Facet_Abstract

Sets a filter for this facet.

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

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.

Parameters
Name Type Description
$global bool

Flag to either run the facet globally.

Returns
Type Description
\Elastica_Facet_Abstract
methodpublicsetName( string $name ) : \Elastica_Facet_Abstract

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

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

Parameter list

Returns
Type Description
\Elastica_Param
methodpublictoArray( ) : array

Basic definition of all specs of the facet. Each implementation should override this function in order to set it's specific settings.

Returns
Type Description
array
Documentation was generated by DocBlox 0.18.1.