From 1e7a16c26425530046b86a6d11b9795bb5d88926 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 25 Apr 2009 21:25:15 +0000 Subject: [PATCH] r1842@llin: dpavlin | 2009-04-25 23:25:15 +0200 fix seeking in search results and returning only single page git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1170 07558da8-63fa-0310-ba24-9fe276d99e06 --- vhost/webpac2.cgi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vhost/webpac2.cgi b/vhost/webpac2.cgi index 79adc7d..b0a919e 100755 --- a/vhost/webpac2.cgi +++ b/vhost/webpac2.cgi @@ -218,6 +218,8 @@ if ( my $search = param('search') ) { $pager->total_entries( $swish_results->hits ); + $swish_results->seek_result( $pager->first ); + if ( ! $pager->total_entries ) { my $no_results = 'No results for search %s'; $no_results = $swish->error_string . '
%s' if $swish->error; @@ -234,7 +236,11 @@ if ( my $search = param('search') ) { my $start = $pager->first; print qq|
    \n|; + my $limit = $pager->entries_on_this_page; + while ( my $result = $swish_results->next_result ) { + last if $limit-- == 0; + my $data = from_json $result->property('data'); dump_yaml( 'data', $data ); -- 2.20.1