include/SugarSearchEngine/Elastic/Elastica/Facet/Abstract.php
Abstract facet object. Should be extended by all facet types
- Author
- Nicolas Ruflin
- Author
- Jasper van Wanrooy
- Category
- Xodoa
- Package
- Elastica
\Elastica_Facet_Abstract
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
array
$_params= 'array()'
array()
Details- Type
- array
- Inherited_from
- \Elastica_Param::$$_params
$_rawParams= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \Elastica_Param::$$_rawParams
Methods
__construct(
string $name
)
:
void
Constructs a Facet object.
Name | Type | Description |
---|---|---|
$name | string | The name of the facet. |
_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.
Name | Type | Description |
---|---|---|
$key | string | The key of the param to set. |
$value | mixed | The value of the param. |
Type | Description |
---|---|
\Elastica_Facet_Abstract |
_setRawParam(
string $key, mixed $value
)
:
\Elastica_Param
Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Type | Description |
---|---|
\Elastica_Param |
addParam(
string $key, mixed $value
)
:
\Elastica_Param
This function can be used to add an array of params
Name | Type | Description |
---|---|---|
$key | string | Param key |
$value | mixed | Value to set |
Type | Description |
---|---|
\Elastica_Param |
getParam(
string $key
)
:
mixed
Name | Type | Description |
---|---|---|
$key | string | Key to return |
Type | Description |
---|---|
mixed | Key value |
Exception | Description |
---|---|
\Elastica_Exception_Invalid | If requested key is not set |
setFilter(
\Elastica_Filter_Abstract $filter
)
:
\Elastica_Facet_Abstract
Sets a filter for this facet.
Name | Type | Description |
---|---|---|
$filter | \Elastica_Filter_Abstract | A filter to apply on the facet. |
Type | Description |
---|---|
\Elastica_Facet_Abstract |
setGlobal(
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.
Name | Type | Description |
---|---|---|
$global | bool | Flag to either run the facet globally. |
Type | Description |
---|---|
\Elastica_Facet_Abstract |
setName(
string $name
)
:
\Elastica_Facet_Abstract
Sets the name of the facet. It is automatically set by the constructor.
Name | Type | Description |
---|---|---|
$name | string | The name of the facet. |
Type | Description |
---|---|
\Elastica_Facet_Abstract |
Exception | Description |
---|---|
\Elastica_Exception_Invalid |
setParam(
string $key, mixed $value
)
:
void
Name | Type | Description |
---|---|---|
$key | string | Key to set |
$value | mixed | Key Value |
setParams(
array $params
)
:
\Elastica_Param
Name | Type | Description |
---|---|---|
$params | array | Parameter list |
Type | Description |
---|---|
\Elastica_Param |