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

Show: inherited
Table of Contents

Implements the terms facet.

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

\Elastica_Facet_Terms

Package: Elastica

Implements the terms facet.

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

Parent(s)
\Elastica_Facet_Abstract < \Elastica_Param
Author
Nicolas Ruflin  
Author
Jasper van Wanrooy  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/search/facets/terms-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  $_orderTypes= 'array('count', 'term', 'reverse_count', 'reverse_term')'

Holds the types of ordering which are allowed by ElasticSearch.

Default valuearray('count', 'term', 'reverse_count', 'reverse_term')Details
Type
array
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
methodpublicsetAllTerms( bool $allTerms ) : \Elastica_Facet_Terms

Sets the flag to return all available terms. When they don't have a hit, they have a count of zero.

Parameters
Name Type Description
$allTerms bool

Flag to fetch all terms.

Returns
Type Description
\Elastica_Facet_Terms
methodpublicsetExclude( array $exclude ) : \Elastica_Facet_Terms

Set an array with terms which are omitted in the search.

Parameters
Name Type Description
$exclude array

Numerical array which includes all terms which needs to be ignored.

Returns
Type Description
\Elastica_Facet_Terms
methodpublicsetField( string $field ) : \Elastica_Facet_Terms

Sets the field for the terms.

Parameters
Name Type Description
$field string

The field name for the terms.

Returns
Type Description
\Elastica_Facet_Terms
methodpublicsetFields( array $fields ) : \Elastica_Facet_Terms

Sets multiple fields for the terms.

Parameters
Name Type Description
$fields array

Numerical array with the fields for the terms.

Returns
Type Description
\Elastica_Facet_Terms
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
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
methodpublicsetOrder( string $type ) : \Elastica_Facet_Terms

Sets the ordering type for this facet. ElasticSearch internal default is count.

Parameters
Name Type Description
$type string

The order type to set use for sorting of the terms.

Returns
Type Description
\Elastica_Facet_Terms
Throws
Exception Description
\Elastica_Exception_Invalid When an invalid order type was set.
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
methodpublicsetSize( int $size ) : \Elastica_Facet_Terms

Sets the amount of terms to be returned.

Parameters
Name Type Description
$size int

The amount of terms to be returned.

Returns
Type Description
\Elastica_Facet_Terms
methodpublictoArray( ) : array

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

Returns
Type Description
array
Details
See
\Elastica_Facet_Abstract::toArray()  
Documentation was generated by DocBlox 0.18.1.