--- trunk/vhost/webpac2.cgi 2009/04/26 00:07:58 1174 +++ trunk/vhost/webpac2.cgi 2009/04/26 15:04:52 1175 @@ -182,11 +182,6 @@ my $swish = SWISH::API->new( "$dir/../var/swish/$database" ); $swish->abort_last_error if $swish->Error; - my $pager = Data::Page->new; - $pager->$_( param($_) ) foreach ( qw/entries_per_page current_page/ ); - - dump_yaml( 'pager', $pager ); - my @search = (); if ( $search =~ m{(=|"|AND|OR)} ) { push @search, $search; @@ -224,9 +219,13 @@ dump_yaml( 'swish_results', $swish_results ); + my $pager = Data::Page->new; + $pager->$_( param($_) ) foreach ( qw/entries_per_page current_page/ ); $pager->total_entries( $swish_results->hits ); - $swish_results->seek_result( $pager->first ); + dump_yaml( 'pager', $pager ); + + $swish_results->seek_result( $pager->first - 1 ); if ( ! $pager->total_entries ) { my $no_results = 'No results for search %s'; @@ -241,13 +240,12 @@ print qq|