diff --git a/module/VuFind/src/VuFind/Controller/SearchController.php b/module/VuFind/src/VuFind/Controller/SearchController.php index 2fd1fad0d1a19a619a91bb8233a316be7eb273ed..205d4c137386a034c580b42924bed12e1497dfee 100644 --- a/module/VuFind/src/VuFind/Controller/SearchController.php +++ b/module/VuFind/src/VuFind/Controller/SearchController.php @@ -510,8 +510,7 @@ class SearchController extends AbstractSearch // Because we're coming in from a search, we want to do a fuzzy // tag search, not an exact search like we would when linking to a // specific tag name. - $query = $this->getRequest()->getQuery() - ->set('hiddenFilters', ['fuzzy:true']); + $query = $this->getRequest()->getQuery()->set('fuzzy', 'true'); return $this->forwardTo('Tag', 'Home'); } diff --git a/module/VuFind/src/VuFind/Search/Tags/Params.php b/module/VuFind/src/VuFind/Search/Tags/Params.php index f1b9fafb1cbfd5cffc35b0ba4bf5e7d0301f4a8f..8e8787989b34cbb6218ac541a16ae9ca5e7bc16b 100644 --- a/module/VuFind/src/VuFind/Search/Tags/Params.php +++ b/module/VuFind/src/VuFind/Search/Tags/Params.php @@ -38,4 +38,34 @@ namespace VuFind\Search\Tags; */ class Params extends \VuFind\Search\Base\Params { + /** + * Is this a fuzzy search? + * + * @var bool + */ + protected $fuzzy = false; + + /** + * Is this a fuzzy search? + * + * @var bool + */ + public function isFuzzyTagSearch() + { + return $this->fuzzy; + } + + /** + * Pull the search parameters + * + * @param \Zend\StdLib\Parameters $request Parameter object representing user + * request. + * + * @return void + */ + public function initFromRequest($request) + { + parent::initFromRequest($request); + $this->fuzzy = ('true' == $request->get('fuzzy', 'false')); + } } diff --git a/module/VuFind/src/VuFind/Search/Tags/Results.php b/module/VuFind/src/VuFind/Search/Tags/Results.php index 302fa5ac46f508d6e587815ec8de5c4d236ad7fb..e27e331df0de0a8b7c580e3ac1995f7916a3fc63 100644 --- a/module/VuFind/src/VuFind/Search/Tags/Results.php +++ b/module/VuFind/src/VuFind/Search/Tags/Results.php @@ -123,8 +123,7 @@ class Results extends BaseResults // we are coming in from a search, in which case we want to do a fuzzy // search that supports wildcards, or else we are coming in from a tag // link, in which case we want to do an exact match. - $hf = $this->getParams()->getHiddenFilters(); - $rawResults = (isset($hf['fuzzy']) && in_array('true', $hf['fuzzy'])) + $rawResults = $this->getParams()->isFuzzyTagSearch() ? $this->performFuzzyTagSearch() : $this->performExactTagSearch();