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

Class: SolrFacetCounts

Source Location: /src/search/SolrFacetCounts.php

Class Overview


The facet counts attached to a SolrSearchResult.


Author(s):

Methods



Class Details

[line 73]
The facet counts attached to a SolrSearchResult.

php_solr currently only supports facet fields. If there are facet fields attached to your result, you can iterate over the $fields array to access them.

Example: A search result with a facet field "author" with 10 hits for author "Smith" and 5 hits for author "Miller".

  1.  // $searchResult is a SolrSearchResult object returned by
  2.  // SolrConnection::query().
  3.  
  4.  foreach ($searchResult->facets['author'as $value => $count{
  5.      echo "I have found $count books for the author $value.\n";
  6.  }

The result would look like this:

 I have found 10 books for the author Smith.
 I have found 5 books for the author Miller.




Tags:

property-read:  array $fields: Facet fields.
author:  Alexander M. Turek <rabus@users.sourceforge.net>
since:  0.4.0


[ Top ]


Class Methods


static method parseResponse [line 103]

static SolrFacetCounts parseResponse( object $jsonResponse)

Parses the 'facet_fields' part of the JSON response.



Tags:

access:  public


Parameters:

object   $jsonResponse  

[ Top ]

method __get [line 125]

mixed __get( string $property)

Getter for magic properties.



Tags:

access:  public


Parameters:

string   $property   The parameter.

[ Top ]


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