From 8a8117216794fc86bbccb9af48e382f61d62009a Mon Sep 17 00:00:00 2001 From: David Maus <maus@hab.de> Date: Mon, 13 May 2013 15:15:37 +0200 Subject: [PATCH] Set offset and limit in parameter bag * VuFindSearch/Backend/Solr/Backend.php (search): Set offset and limit in parameter bag. * VuFindSearch/Backend/Solr/Connector.php (search): Change function signature, offset and limit contained in parameter bag. --- .../VuFindSearch/src/VuFindSearch/Backend/Solr/Backend.php | 4 +++- .../src/VuFindSearch/Backend/Solr/Connector.php | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Backend.php b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Backend.php index 0f2790e0d7b..7f18a87fd19 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Backend.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Backend.php @@ -169,8 +169,10 @@ class Backend implements BackendInterface, MoreLikeThis, RetrieveBatchInterface } } + $params->set('rows', $limit); + $params->set('start', $offset); $params->mergeWith($this->getQueryBuilder()->build($query)); - $response = $this->connector->search($params, $offset, $limit); + $response = $this->connector->search($params); $collection = $this->createRecordCollection($response); $this->injectSourceIdentifier($collection); diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Connector.php b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Connector.php index ba20981967f..fb89e0119ce 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Connector.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Connector.php @@ -208,15 +208,11 @@ class Connector * Execute a search. * * @param ParamBag $params Parameters - * @param integer $offset Search offset - * @param integer $limit Search limit * * @return string */ - public function search(ParamBag $params, $offset, $limit) + public function search(ParamBag $params) { - $params->set('start', $offset); - $params->set('rows', $limit); return $this->select($params); } -- GitLab