From e1f5681bbf31176a03c1c2f14d68252ba15f7d43 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 8 Aug 2007 17:39:45 +0200 Subject: [PATCH] pagination did not work anymore : we stepped only 1 record by 1 record. fixes the problem Signed-off-by: Chris Cormack --- catalogue/search.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index e7bc91165a..f6ba53072c 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -380,7 +380,8 @@ push @limits, map "yr:".$_, split("\0",$params->{'limit-yr'}) if $params->{'limi my $query = $params->{'q'}; my $scan = $params->{'scan'}; my $results_per_page = $params->{'count'} || 20; -my $offset = $params->{'offset'} || 0; +my $page = $cgi->param('page') || 1; +my $offset = ($page-1)*$results_per_page; my $hits; my $expanded_facet = $params->{'expand'}; @@ -446,7 +447,7 @@ for (my $i=0;$i<=@servers;$i++) { if ($server =~/biblioserver/) { # this is the local bibliographic server $hits = $results_hashref->{$server}->{"hits"}; my $page = $cgi->param('page') || 0; - my @newresults = searchResults( $search_desc,$hits,$results_per_page,$page,@{$results_hashref->{$server}->{"RECORDS"}}); + my @newresults = searchResults( $search_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}}); $total = $total + $results_hashref->{$server}->{"hits"}; if ($hits) { $template->param(total => $hits); -- 2.39.5