From 1719ff3933ec51593e8703639d6c74e77906fff0 Mon Sep 17 00:00:00 2001 From: Thibaud Guillot Date: Fri, 31 Dec 2021 09:12:22 +0100 Subject: [PATCH] Bug 26537: (follow-up) fix paging of results Also I renamed "es_query" variable for better understanding (this script works with Elastic search but also Zebra) Signed-off-by: Owen Leonard --- cataloguing/value_builder/unimarc_field_4XX.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index a2be2f802c..042aba59fd 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -347,8 +347,8 @@ sub plugin { my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); - my ($builderror, $es_query)= $builder->build_query_compat( undef, [$search], ['kw'], $limits, ['relevance']); - my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($es_query, $startfrom * $resultsperpage, $resultsperpage ); + my ($builderror, $search_query)= $builder->build_query_compat( undef, [$search], ['kw'], $limits, ['relevance']); + my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($search_query, $startfrom * $resultsperpage, $resultsperpage ); if (defined $errors ) { $results = []; } @@ -445,7 +445,7 @@ sub plugin { if ( $total_hits < $from + $resultsperpage ) { $to = $total_hits; }else{ - $to = $startfrom * $resultsperpage + $resultsperpage ; + $to = $from * $resultsperpage ; } # my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search"; # foreach my $sort (@sort_by){ -- 2.25.1