Bug 14385: Extend OpacHiddenItems to allow specifying exempt borrower categories
[koha.git] / catalogue / search.pl
index 7e2e300..d9961a0 100755 (executable)
@@ -541,7 +541,7 @@ for (my $i=0;$i<@servers;$i++) {
     if ($server =~/biblioserver/) { # this is the local bibliographic server
         my $hits = $results_hashref->{$server}->{"hits"} // 0;
         my $page = $cgi->param('page') || 0;
-        my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan,
+        my @newresults = searchResults({ 'interface' => 'intranet' }, $query_desc, $hits, $results_per_page, $offset, $scan,
                                        $results_hashref->{$server}->{"RECORDS"});
         $total = $total + $hits;
 
@@ -619,7 +619,9 @@ for (my $i=0;$i<@servers;$i++) {
             ## FIXME: add a global function for this, it's better than the current global one
             ## Build the page numbers on the bottom of the page
             my @page_numbers;
-            my $hits_to_paginate = C4::Context->preference('SearchEngine') eq 'Elasticsearch' ? 10000 : $hits;
+            my $max_result_window = $searcher->max_result_window;
+            my $hits_to_paginate = ($max_result_window && $max_result_window < $hits) ? $max_result_window : $hits;
+            $template->param( hits_to_paginate => $hits_to_paginate );
             # total number of pages there will be
             my $pages = ceil($hits_to_paginate / $results_per_page);
             my $last_page_offset = ( $pages -1 ) * $results_per_page;