Skip to content
Snippets Groups Projects
Commit 5d53a5b5 authored by Demian Katz's avatar Demian Katz
Browse files

Use Search Manager for reserves and new items.

parent 033a4ebc
No related merge requests found
...@@ -345,7 +345,8 @@ class SearchController extends AbstractSearch ...@@ -345,7 +345,8 @@ class SearchController extends AbstractSearch
$resultPages = 10; $resultPages = 10;
} }
$catalog = ConnectionManager::connectToCatalog(); $catalog = ConnectionManager::connectToCatalog();
$params = new \VuFind\Search\Solr\Params(); $sm = $this->getSearchManager()->setSearchClassId('Solr');
$params = $sm->getParams();
$perPage = $params->getLimit(); $perPage = $params->getLimit();
$newItems = $catalog->getNewItems(1, $perPage * $resultPages, $range, $dept); $newItems = $catalog->getNewItems(1, $perPage * $resultPages, $range, $dept);
...@@ -432,9 +433,10 @@ class SearchController extends AbstractSearch ...@@ -432,9 +433,10 @@ class SearchController extends AbstractSearch
*/ */
public function reservessearchAction() public function reservessearchAction()
{ {
$params = new \VuFind\Search\SolrReserves\Params(); $sm = $this->getSearchManager()->setSearchClassId('SolrReserves');
$params = $sm->getParams();
$params->initFromRequest($this->getRequest()->getQuery()); $params->initFromRequest($this->getRequest()->getQuery());
$results = new \VuFind\Search\SolrReserves\Results($params); $results = $sm->getResults($params);
return $this->createViewModel(array('results' => $results)); return $this->createViewModel(array('results' => $results));
} }
...@@ -458,7 +460,8 @@ class SearchController extends AbstractSearch ...@@ -458,7 +460,8 @@ class SearchController extends AbstractSearch
$bibIDs = array_unique(array_map($callback, $result)); $bibIDs = array_unique(array_map($callback, $result));
// Truncate the list if it is too long: // Truncate the list if it is too long:
$params = new \VuFind\Search\Solr\Params(); $sm = $this->getSearchManager()->setSearchClassId('Solr');
$params = $sm->getParams();
$limit = $params->getQueryIDLimit(); $limit = $params->getQueryIDLimit();
if (count($bibIDs) > $limit) { if (count($bibIDs) > $limit) {
$bibIDs = array_slice($bibIDs, 0, $limit); $bibIDs = array_slice($bibIDs, 0, $limit);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment