createSelect(); // get the facetset component $facetSet = $query->getFacetSet(); // create a facet field instance and set options $facetSet->createFacetField('stock')->setField('inStock'); // 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 counts echo '
id | ' . $document->id . ' |
---|---|
name | ' . $document->name . ' |
price | ' . $document->price . ' |