From 7904687b51f6ede58584d07b67ded4c448a33a92 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 23 Aug 2012 13:14:10 -0400 Subject: [PATCH] Fixed special-case tag search. --- module/VuFind/src/VuFind/Search/Solr/Params.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/Solr/Params.php b/module/VuFind/src/VuFind/Search/Solr/Params.php index 8238be6e064..f200359e670 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Params.php +++ b/module/VuFind/src/VuFind/Search/Solr/Params.php @@ -26,7 +26,7 @@ * @link http://www.vufind.org Main Page */ namespace VuFind\Search\Solr; -use VuFind\Config\Reader as ConfigReader, +use VuFind\Config\Reader as ConfigReader, VuFind\Db\Table\Tags as TagsTable, VuFind\Search\Base\Params as BaseParams; /** @@ -177,7 +177,7 @@ class Params extends BaseParams */ public function initTagSearch() { - $table = new VuFind_Model_Db_Tags(); + $table = new TagsTable(); $tag = $table->getByText($this->getDisplayQuery()); if (!empty($tag)) { $rawResults = $tag->getResources('VuFind'); @@ -385,6 +385,12 @@ class Params extends BaseParams { // No need for spell checking on an ID query! $this->options->spellcheckEnabled(false); + + // Special case -- no IDs to set: + if (empty($ids)) { + return $this->setOverrideQuery('NOT *:*'); + } + $callback = function($i) { return '"' . addcslashes($i, '"') . '"'; }; -- GitLab