Solarium/Query/Select/Component/Facet/Field.php
Copyright 2011 Bas de Nooijer. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this listof conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the copyright holder.
- Copyright
- Copyright 2011 Bas de Nooijer
- License
- http://github.com/basdenooijer/solarium/raw/master/COPYING
- Link
- http://www.solarium-project.org/
- Package
- Solarium
- Subpackage
- Query
\Solarium_Query_Select_Component_Facet_Field
Facet query
All classes extending this class are configurable using the constructor or setOption calls. This is the base for many Solarium classes, providing a uniform interface for various models.
- Parent(s)
- \Solarium_Query_Select_Component_Facet < \Solarium_Configurable
- Link
- http://wiki.apache.org/solr/SimpleFacetParameters#Field_Value_Faceting_Parameters
Constants
Properties

array
$_excludes= 'array()'
Exclude tags for this facet
Inherited from: \Solarium_Query_Select_Component_Facet::$_excludesarray()Details- Type
- array
- Inherited_from
- \Solarium_Query_Select_Component_Facet::$_excludes
Methods

__construct(
array|\Zend_Config $options
=
null
)
:
void
If options are passed they will be merged with {@link $_options} using the {@link setOptions()} method.
After handling the options the {@link _init()} method is called.
| Name | Type | Description |
|---|---|---|
| $options | array|\Zend_Config |
| Exception | Description |
|---|---|
| \Solarium_Exception |

_init(
)
:
void
Can be used by classes for special behaviour. For instance some options have extra setup work in their 'set' method that also need to be called when the option is passed as a constructor argument.
This hook is called by the constructor after saving the constructor arguments in {@link $_options}

_setOption(
string $name, mixed $value
)
:
\Solarium_Configurable
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $value | mixed |
| Type | Description |
|---|---|
| \Solarium_Configurable |

addExclude(
string $tag
)
:
\Solarium_Query_Select_Component_Facet
| Name | Type | Description |
|---|---|---|
| $tag | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet | Provides fluent interface |

addExcludes(
array $excludes
)
:
\Solarium_Query_Select_Component_FacetAdd multiple exclude tags
Inherited from: \Solarium_Query_Select_Component_Facet::addExcludes()| Name | Type | Description |
|---|---|---|
| $excludes | array |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet | Provides fluent interface |

clearExcludes(
)
:
\Solarium_Query_Select_FacetRemove all excludes
Inherited from: \Solarium_Query_Select_Component_Facet::clearExcludes()| Type | Description |
|---|---|
| \Solarium_Query_Select_Facet | Provides fluent interface |

getOption(
string $name
)
:
mixed
If the option is empty or not set a NULL value will be returned.
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| mixed |

removeExclude(
string $exclude
)
:
\Solarium_Query_Select_Component_FacetRemove a single exclude tag
Inherited from: \Solarium_Query_Select_Component_Facet::removeExclude()| Name | Type | Description |
|---|---|---|
| $exclude | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet | Provides fluent interface |

setExcludes(
array $excludes
)
:
voidSet multiple excludes
Inherited from: \Solarium_Query_Select_Component_Facet::setExcludes()This overwrites any existing excludes
| Name | Type | Description |
|---|---|---|
| $excludes | array |

setField(
string $field
)
:
\Solarium_Query_Select_Component_Facet_FieldSet the field name
| Name | Type | Description |
|---|---|---|
| $field | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |

setKey(
string $value
)
:
\Solarium_Query_Select_Component_Facet
| Name | Type | Description |
|---|---|---|
| $value | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet | Provides fluent interface |

setLimit(
int $limit
)
:
\Solarium_Query_Select_Component_Facet_FieldSet the facet limit
| Name | Type | Description |
|---|---|---|
| $limit | int |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |

setMethod(
string $method
)
:
\Solarium_Query_Select_Facet_FieldSet the facet method
Use one of the METHOD_* constants as value
| Name | Type | Description |
|---|---|---|
| $method | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Facet_Field | Provides fluent interface |

setMinCount(
int $minCount
)
:
\Solarium_Query_Select_Component_Facet_FieldSet the facet mincount
| Name | Type | Description |
|---|---|---|
| $minCount | int |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |

setMissing(
boolean $missing
)
:
\Solarium_Query_Select_Component_Facet_FieldSet the missing count option
| Name | Type | Description |
|---|---|---|
| $missing | boolean |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |

setOffset(
int $offset
)
:
\Solarium_Query_Select_Component_Facet_FieldSet the facet offset
| Name | Type | Description |
|---|---|---|
| $offset | int |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |

setOptions(
array|\Zend_Config $options, boolean $overwrite
=
false
)
:
void
If $options is an object it will be converted into an array by called it's toArray method. This is compatible with the Zend_Config classes in Zend Framework, but can also easily be implemented in any other object.
| Name | Type | Description |
|---|---|---|
| $options | array|\Zend_Config | |
| $overwrite | boolean | True for overwriting existing options, false for merging (new values overwrite old ones if needed) |
| Exception | Description |
|---|---|
| \Solarium_Exception |

setPrefix(
string $prefix
)
:
\Solarium_Query_Select_Component_Facet_FieldLimit the terms for faceting by a prefix
| Name | Type | Description |
|---|---|---|
| $prefix | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |

setSort(
string $sort
)
:
\Solarium_Query_Select_Component_Facet_FieldSet the facet sort order
Use one of the SORT_* constants as the value
| Name | Type | Description |
|---|---|---|
| $sort | string |
| Type | Description |
|---|---|
| \Solarium_Query_Select_Component_Facet_Field | Provides fluent interface |