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;
## 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;