Solarium/Query/Select/Component/Facet/Field.php

Show: inherited
Table of Contents

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. 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

Package: Solarium\Query

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

Constant  SORT_INDEX = 'index'

Facet sort type index

Constant  SORT_COUNT = 'count'

Facet sort type count

Constant  METHOD_ENUM = 'enum'

Facet method enum

Constant  METHOD_FC = 'fc'

Facet method fc

Properties

Propertyprotectedarray  $_excludes= 'array()'
inherited

Exclude tags for this facet

Inherited from: \Solarium_Query_Select_Component_Facet::$_excludes
Default valuearray()Details
Type
array
Inherited_from
\Solarium_Query_Select_Component_Facet::$_excludes  
Propertyprotectedarray  $_options= 'array( 'field' => 'id' )'

Default options

Default valuearray( 'field' => 'id' )Details
Type
array

Methods

methodpublic__construct( array|\Zend_Config $options = null ) : void
inherited

Constructor

Inherited from: \Solarium_Configurable::__construct()

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.

Parameters
Name Type Description
$options array|\Zend_Config
Throws
Exception Description
\Solarium_Exception
methodprotected_init( ) : void
inherited

Initialize options

Inherited from: \Solarium_Query_Select_Component_Facet::_init()

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}

methodprotected_setOption( string $name, mixed $value ) : \Solarium_Configurable
inherited

Set an option

Inherited from: \Solarium_Configurable::_setOption()
Parameters
Name Type Description
$name string
$value mixed
Returns
Type Description
\Solarium_Configurable
methodpublicaddExclude( string $tag ) : \Solarium_Query_Select_Component_Facet
inherited

Add an exclude tag

Inherited from: \Solarium_Query_Select_Component_Facet::addExclude()
Parameters
Name Type Description
$tag string
Returns
Type Description
\Solarium_Query_Select_Component_Facet Provides fluent interface
methodpublicaddExcludes( array $excludes ) : \Solarium_Query_Select_Component_Facet
inherited

Add multiple exclude tags

Inherited from: \Solarium_Query_Select_Component_Facet::addExcludes()
Parameters
Name Type Description
$excludes array
Returns
Type Description
\Solarium_Query_Select_Component_Facet Provides fluent interface
methodpublicclearExcludes( ) : \Solarium_Query_Select_Facet
inherited

Remove all excludes

Inherited from: \Solarium_Query_Select_Component_Facet::clearExcludes()
Returns
Type Description
\Solarium_Query_Select_Facet Provides fluent interface
methodpublicgetExcludes( ) : array
inherited

Get all excludes

Inherited from: \Solarium_Query_Select_Component_Facet::getExcludes()
Returns
Type Description
array
methodpublicgetField( ) : string

Get the field name

Returns
Type Description
string
methodpublicgetKey( ) : string
inherited

Get key value

Inherited from: \Solarium_Query_Select_Component_Facet::getKey()
Returns
Type Description
string
methodpublicgetLimit( ) : string

Get the facet limit

Returns
Type Description
string
methodpublicgetMethod( ) : string

Get the facet method

Returns
Type Description
string
methodpublicgetMinCount( ) : int

Get the facet mincount

Returns
Type Description
int
methodpublicgetMissing( ) : boolean

Get the facet missing option

Returns
Type Description
boolean
methodpublicgetOffset( ) : int

Get the facet offset

Returns
Type Description
int
methodpublicgetOption( string $name ) : mixed
inherited

Get an option value by name

Inherited from: \Solarium_Configurable::getOption()

If the option is empty or not set a NULL value will be returned.

Parameters
Name Type Description
$name string
Returns
Type Description
mixed
methodpublicgetOptions( ) : array
inherited

Get all options

Inherited from: \Solarium_Configurable::getOptions()
Returns
Type Description
array
methodpublicgetPrefix( ) : string

Get the facet prefix

Returns
Type Description
string
methodpublicgetSort( ) : string

Get the facet sort order

Returns
Type Description
string
methodpublicgetType( ) : string

Get the facet type

Returns
Type Description
string
methodpublicremoveExclude( string $exclude ) : \Solarium_Query_Select_Component_Facet
inherited

Remove a single exclude tag

Inherited from: \Solarium_Query_Select_Component_Facet::removeExclude()
Parameters
Name Type Description
$exclude string
Returns
Type Description
\Solarium_Query_Select_Component_Facet Provides fluent interface
methodpublicsetExcludes( array $excludes ) : void
inherited

Set multiple excludes

Inherited from: \Solarium_Query_Select_Component_Facet::setExcludes()

This overwrites any existing excludes

Parameters
Name Type Description
$excludes array
methodpublicsetField( string $field ) : \Solarium_Query_Select_Component_Facet_Field

Set the field name

Parameters
Name Type Description
$field string
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
methodpublicsetKey( string $value ) : \Solarium_Query_Select_Component_Facet
inherited

Set key value

Inherited from: \Solarium_Query_Select_Component_Facet::setKey()
Parameters
Name Type Description
$value string
Returns
Type Description
\Solarium_Query_Select_Component_Facet Provides fluent interface
methodpublicsetLimit( int $limit ) : \Solarium_Query_Select_Component_Facet_Field

Set the facet limit

Parameters
Name Type Description
$limit int
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
methodpublicsetMethod( string $method ) : \Solarium_Query_Select_Facet_Field

Set the facet method

Use one of the METHOD_* constants as value

Parameters
Name Type Description
$method string
Returns
Type Description
\Solarium_Query_Select_Facet_Field Provides fluent interface
methodpublicsetMinCount( int $minCount ) : \Solarium_Query_Select_Component_Facet_Field

Set the facet mincount

Parameters
Name Type Description
$minCount int
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
methodpublicsetMissing( boolean $missing ) : \Solarium_Query_Select_Component_Facet_Field

Set the missing count option

Parameters
Name Type Description
$missing boolean
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
methodpublicsetOffset( int $offset ) : \Solarium_Query_Select_Component_Facet_Field

Set the facet offset

Parameters
Name Type Description
$offset int
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
methodpublicsetOptions( array|\Zend_Config $options, boolean $overwrite = false ) : void
inherited

Set options

Inherited from: \Solarium_Configurable::setOptions()

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.

Parameters
Name Type Description
$options array|\Zend_Config
$overwrite boolean

True for overwriting existing options, false for merging (new values overwrite old ones if needed)

Throws
Exception Description
\Solarium_Exception
methodpublicsetPrefix( string $prefix ) : \Solarium_Query_Select_Component_Facet_Field

Limit the terms for faceting by a prefix

Parameters
Name Type Description
$prefix string
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
methodpublicsetSort( string $sort ) : \Solarium_Query_Select_Component_Facet_Field

Set the facet sort order

Use one of the SORT_* constants as the value

Parameters
Name Type Description
$sort string
Returns
Type Description
\Solarium_Query_Select_Component_Facet_Field Provides fluent interface
Documentation was generated by DocBlox 0.15.1.