/** Create the facets boxes for rendering * @access public * @param array $facets * @return string * @throws Pas_Exception */ public function mapFacetCreatorMyFinds() { $params = Zend_Controller_Front::getInstance()->getRequest()->getParams(); $params['createdBy'] = $this->_id; $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(); if (is_array($facets)) { $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'); } }
/** 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'); } }