createSelect(); // get the facetset component $facetSet = $query->getFacetSet(); // create a facet query instance and set options $facetSet->createFacetQuery('stock')->setQuery('inStock: true'); // this executes the query and returns the result $resultset = $client->select($query); // display the total number of documents found by solr echo 'NumFound: '.$resultset->getNumFound(); // display facet query count $count = $resultset->getFacetSet()->getFacet('stock')->getValue(); echo '
id | ' . $document->id . ' |
---|---|
name | ' . $document->name . ' |
price | ' . $document->price . ' |