/** Create the facets boxes for rendering * @access public * @param array $facets * @return string * @throws Pas_Exception */ public function mapFacetCreator() { $params = Zend_Controller_Front::getInstance()->getRequest()->getParams(); $search = new Pas_Solr_Handler(); $search->setCore('objects'); $search->setParams($params); $search->setFacets(array('objectType', 'county', 'broadperiod', 'institution', 'rulerName', 'denominationName', 'mintName', 'workflow')); $search->setMap(true); $search->execute(); $facets = $search->processFacets(); $total = $search->getNumber(); if (is_array($facets)) { $html = '<p>Total results available: ' . number_format($total) . '<br />These results might differ to the expected results. We only allow you to see records available to you</p>'; $html .= '<h3 class="lead">Search facets</h3>'; foreach ($facets as $facetName => $facet) { $html .= $this->_processFacet($facet, $facetName); } return $html; } else { throw new Pas_Exception('The facets sent are not an array'); } }
/** Get the data from the solr index * @access public * @param string $constituency * @return int */ public function getSolr($constituency) { $geometry = $this->getGeometry($constituency); $bbox = array($geometry->min_lat, $geometry->min_lon, $geometry->max_lat, $geometry->max_lon); $search = new Pas_Solr_Handler(); $search->setCore('objects'); $search->setFields(array('id', 'identifier', 'objecttype', 'title', 'broadperiod', 'imagedir', 'filename', 'thumbnail', 'old_findID', 'description', 'county')); $search->setParams(array('bbox' => implode(',', $bbox))); $search->execute(); $this->_geometry = implode(',', $bbox); return $search->getNumber(); }