php_solr
[ class tree: php_solr ] [ index: php_solr ] [ all elements ]

Class: SolrSimpleFacets

Source Location: /src/search/SolrSimpleFacets.php

Class Overview

SolrFacetFieldParameters
   |
   --SolrSimpleFacets

A set of parameters to enable Solr's SimpleFacets in SolrQuery.


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: SolrFacetFieldParameters

SolrFacetFieldParameters::buildQueryParameter()
Builds a query parameter.
SolrFacetFieldParameters::getQueryStringPart()
Returns the faceting part of the HTTP query.
SolrFacetFieldParameters::setLimit()
Sets the maximum number of constraint counts.
SolrFacetFieldParameters::setMinCount()
Sets the minimum counts for facet fields.
SolrFacetFieldParameters::setMissing()
Include "missing value" as a facet count?
SolrFacetFieldParameters::setOffset()
Sets the offset for the the list of constraints to allow paging.
SolrFacetFieldParameters::setPrefix()
Sets the facet prefix.
SolrFacetFieldParameters::setSort()
Sets the ordering of the facets.

Class Details

[line 65]
A set of parameters to enable Solr's SimpleFacets in SolrQuery.

Facets are enabled for your query if you specify at least one facet field using the setFields() method.

Example: Enabling faceting for the field 'category'.

  1.  $query new SolrQuery('hello world');
  2.  $query->facets->setFields('category');




Tags:

author:  Alexander M. Turek <rabus@users.sourceforge.net>
see:  http://wiki.apache.org/solr/SimpleFacetParameters
todo:  Allow per-field parameters.
since:  0.4.0


[ Top ]


Class Methods


method getQueryStringPart [line 91]

string getQueryStringPart( [string $solrSpecVersion = null])

Returns the faceting part of the HTTP query.



Tags:

access:  public
uses:  urlencode()


Overrides SolrFacetFieldParameters::getQueryStringPart() (Returns the faceting part of the HTTP query.)

Parameters:

string   $solrSpecVersion   The servers specification version (optional).

[ Top ]

method setFields [line 157]

void setFields( [SolrFacetField|string|array $fields = null])

Sets the field(s) which should be treated as a facet(s).

Faceting will be considered disabled unless you specify at least one field or query. Multiple fields may be specified as array.

Passing null or calling this function without a parameter removes all facet fields.




Tags:

access:  public


Parameters:

SolrFacetField|string|array   $fields   The fields.

[ Top ]

method setQueries [line 123]

void setQueries( [string|array $queries = null])

Sets the query/queries that should be used to generate a facet count.

Faceting will be considered disabled unless you specify at least one field or query. Multiple queries may be specified as array.

Passing null or calling this function without a parameter removes all facet queries.




Tags:

access:  public


Parameters:

string|array   $queries  

[ Top ]


Documentation generated on Wed, 20 May 2009 12:51:11 +0000 by phpDocumentor 1.4.2