createSelect(); $helper = $query->getHelper(); // add a filterquery on a price range, using the helper to generate the range $query->createFilterQuery('price')->setQuery($helper->rangeQuery('price', 10, 300)); // add a filterquery to find products in a range of 5km, using the helper to generate the 'geofilt' filter $query->createFilterQuery('region')->setQuery($helper->geofilt(45.15, -93.85, 'store', 5)); // 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(); // show documents using the resultset iterator foreach ($resultset as $document) { echo '
' . $field . ' | ' . $value . ' |
---|