diff --git a/module/VuFind/src/VuFind/Controller/SearchController.php b/module/VuFind/src/VuFind/Controller/SearchController.php index 8f295125f74b021e100c95f2f04a0aa533fafb59..f081a100016fda24eff5004db50307959a93dbd6 100644 --- a/module/VuFind/src/VuFind/Controller/SearchController.php +++ b/module/VuFind/src/VuFind/Controller/SearchController.php @@ -519,6 +519,28 @@ class SearchController extends AbstractSearch return $view; } + /** + * Results action. + * + * @return mixed + */ + public function resultsAction() + { + // Special case -- redirect tag searches. + $tag = $this->params()->fromQuery('tag'); + if (!empty($tag)) { + $query = $this->getRequest()->getQuery(); + $query->set('lookfor', $tag); + $query->set('type', 'tag'); + } + if ($this->params()->fromQuery('type') == 'tag') { + return $this->forwardTo('Tag', 'Home'); + } + + // Default case -- standard behavior. + return parent::resultsAction(); + } + /** * Return a Search Results object containing requested facet information. This * data may come from the cache. diff --git a/module/VuFind/src/VuFind/Search/Solr/Params.php b/module/VuFind/src/VuFind/Search/Solr/Params.php index e1935653e84ab265c2f401608e01cb9d87a81865..d66db8e957bdf0bccedc369a22a94e43ff5ea833 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Params.php +++ b/module/VuFind/src/VuFind/Search/Solr/Params.php @@ -159,60 +159,7 @@ class Params extends \VuFind\Search\Base\Params } else { // Use standard initialization: parent::initSearch($request); - - // Another special case -- are we doing a tag search? - $tag = $request->get('tag', ''); - if (!empty($tag)) { - $this->setBasicSearch($tag, 'tag'); - } - if ($this->getSearchHandler() == 'tag') { - $this->initTagSearch(); - } - } - } - - /** - * Restore settings from a minified object found in the database. - * - * @param \VuFind\Search\Minified $minified Minified Search Object - * - * @return void - */ - public function deminify($minified) - { - parent::deminify($minified); - - // Special case: deminified tag searches need some extra help: - if ('tag' == $this->getSearchHandler()) { - $this->initTagSearch(); - } - } - - /** - * Special case -- set up a tag-based search. - * - * @return void - */ - protected function initTagSearch() - { - $table = $this->getTable('Tags'); - $tag = $table->getByText($this->getDisplayQuery()); - if (!empty($tag)) { - $rawResults = $tag->getResources('VuFind'); - } else { - $rawResults = array(); - } - $ids = array(); - $max = $this->getQueryIDLimit(); - $count = 0; - foreach ($rawResults as $current) { - $ids[] = $current->record_id; - // If we have too many hits for Solr to handle, quit now: - if (++$count == $max) { - break; - } } - $this->setQueryIDs($ids); } /**