Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch

When viewing the detail page of the first or last record of a result page,
it's not possible to browse to another page when using Elasticsearch.

To test:
1) Search for "*" in the OPAC
2) Click on the last result of the page
3) Observe that you cannot browse to the next page
4) Apply the patch
5) Search for "*" in the OPAC
6) Click on the last result of the page
7) Observe that you can browse to the next page
8) Sign off

Sponsored-by: Lund University Library

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kevin Carnes 2022-05-25 10:54:25 +00:00 committed by Tomas Cohen Arazi
parent 637c580663
commit 71f54a7571
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 5 additions and 2 deletions

View File

@ -86,6 +86,7 @@ use Koha::Reviews;
use Koha::SearchEngine::Search;
use Koha::SearchEngine::QueryBuilder;
use JSON qw( decode_json );
my $query = CGI->new();
@ -247,7 +248,9 @@ if ($session->param('busc')) {
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
my ($error, $results_hashref, $facets);
eval {
($error, $results_hashref, $facets) = getRecords($arrParamsBusc->{'query'},$arrParamsBusc->{'simple_query'},\@sort_by,\@servers,$results_per_page,$offset,undef,$itemtypes,$arrParamsBusc->{'query_type'},$arrParamsBusc->{'scan'});
my $searcher = Koha::SearchEngine::Search->new(
{ index => $Koha::SearchEngine::BIBLIOS_INDEX } );
($error, $results_hashref, $facets) = $searcher->search_compat(decode_json($arrParamsBusc->{'query'}),$arrParamsBusc->{'simple_query'},\@sort_by,\@servers,$results_per_page,$offset,undef,$itemtypes,$arrParamsBusc->{'query_type'},$arrParamsBusc->{'scan'});
};
my $hits;
my @newresults;

View File

@ -561,7 +561,7 @@ if ($tag) {
# displays search results which should be hidden.
# FIXME: No facets for tags search.
} else {
$pasarParams .= '&amp;query=' . uri_escape_utf8($query);
$pasarParams .= '&amp;query=' . uri_escape_utf8(encode_json($query));
$pasarParams .= '&amp;count=' . uri_escape_utf8($results_per_page);
$pasarParams .= '&amp;simple_query=' . uri_escape_utf8($simple_query);
$pasarParams .= '&amp;query_type=' . uri_escape_utf8($query_type) if ($query_type);