/** Set up the index page * @access public * @return void */ public function indexAction() { $select = array('query' => 'reeceID:[* TO *]'); $params = $this->getAllParams(); $search = new Pas_Solr_Handler(); $search->setCore('objects'); $context = $this->_helper->contextSwitch->getCurrentContext(); $fields = new Pas_Solr_FieldGeneratorFinds($context); $params['format'] = $context; $search->setFields($fields->getFields()); $search->setFacets(array('reeceID')); $search->setParams($params); $search->execute(); $statistics = $search->processFacets(); $stats = array(); foreach ($statistics['reeceID'] as $k => $v) { $stats[$k] = (string) $v; } ksort($stats); $cleaned = array(); foreach ($stats as $k => $v) { $cleaned[] = array('period_name' => 'Reece period ' . $k, 'description' => $v, 'id' => $k); } $this->view->reeces = $cleaned; }
/** Display the index page. */ public function resultsAction() { $params = $this->getAllParams(); $search = new Pas_Solr_Handler(); $search->setCore('objects'); $context = $this->_helper->contextSwitch->getCurrentContext(); $fields = new Pas_Solr_FieldGeneratorFinds(); $fields->setContext($context); if ($context) { $params['format'] = $context; } $search->setFacets(array('objectType', 'county', 'broadperiod', 'institution', 'rulerName', 'denominationName', 'mintName', 'materialTerm', 'workflow', 'reeceID')); $search->setParams($params); $search->execute(); $this->view->facets = $search->processFacets(); $this->view->paginator = $search->createPagination(); $this->view->stats = $search->processStats(); $this->view->results = $search->processResults(); $this->view->server = $search->getLoadBalancerKey(); if (array_key_exists('submit', $params)) { $queries = new Searches(); $queries->insertResults(serialize($params)); } }
/** Display details of a person * @access public * @return void */ public function personAction() { if ($this->getParam('id', false)) { $params = array(); $person = $this->getPeople()->getPersonDetails($this->getParam('id')); if ($this->_helper->contextSwitch()->getCurrentContext() !== 'vcf') { $search = new Pas_Solr_Handler(); $search->setCore('objects'); $fields = new Pas_Solr_FieldGeneratorFinds($this->getCurrentContext()); $search->setFields($fields->getFields()); $params['finderID'] = $person['0']['secuid']; $params['page'] = $this->getParam('page'); $search->setParams($params); $search->execute(); $this->view->paginator = $search->createPagination(); $this->view->finds = $search->processResults(); } $this->view->peoples = $person; } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }
/** My images facet overlay * @access public * @return void */ public function myimagesfacetAction() { $search = new Pas_Solr_Handler(); $search->setCore('images'); $context = $this->_helper->contextSwitch->getCurrentContext(); $fields = new Pas_Solr_FieldGeneratorFinds($context); $search->setFields($fields->getFields()); $search->setFacets(array('licenseAcronym', 'broadperiod', 'county', 'objecttype', 'institution')); $params = $this->getAllParams(); $params['createdBy'] = $this->getIdentityForForms(); $search->setParams($params); $search->execute(); $data = array('facets' => $search->processFacets()); $this->view->data = $data; $this->view->facetName = $this->getParam('facetType'); }