## 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;
# total number of pages there will be
- my $pages = ceil($hits / $results_per_page);
+ my $pages = ceil($hits_to_paginate / $results_per_page);
my $last_page_offset = ( $pages -1 ) * $results_per_page;
# default page number
my $current_page_number = 1;
[% IF ( PAGE_NUMBERS ) %]<nav><ul class="pagination">
+ [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]<h6>10,000 results loaded, refine your search to view other records</h6>[% END %]
[% IF ( previous_page_offset.defined ) %]
<li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">First</a></li>
<!-- Row of numbers corresponding to search result pages -->
[% ELSE %]
<div id="searchresults">
-
[% INCLUDE 'page-numbers.inc' %]
<form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
[% IF ( PAGE_NUMBERS ) %]
<div class="pagination pagination-small noprint">
+ [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]<h6>10000 results loaded, refine your search to view other records</h6>[% END %]
<ul>
[% IF ( previous_page_offset.defined ) %]
<li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">First</a></li>
[% IF ( PAGE_NUMBERS ) %]
<div class="pages">
+ [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]<h6>10000 results loaded, refine your search to view other records</h6>[% END %]
[% IF ( previous_page ) %]
<a class="nav" href="?[% FOREACH fp IN follower_params %][% fp.var |url %]=[% fp.val |url %]&[% END %]page=[% previous_page |url %]"><< Previous</a>
[% END %]
}
## 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;
# total number of pages there will be
- my $pages = ceil($hits / $results_per_page);
+ my $pages = ceil($hits_to_paginate / $results_per_page);
my $last_page_offset = ( $pages - 1 ) * $results_per_page;
# default page number
my $current_page_number = 1;