From 841cb937017ad46a4f43509c4479d0cee37d523c Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 13 Mar 2015 15:27:24 +1300 Subject: [PATCH] Bug 12478: paging is fixed now too Signed-off-by: Nick Clemens Signed-off-by: Jesse Weaver Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- opac/opac-authorities-home.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index a30f5e1eee..62d08148ba 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -279,10 +279,10 @@ warn "Search is " . Dumper $search; # left and right truncation, otherwise an exact phrase push @query_parts, { match_phrase => { $wh => $val }}; } elsif ($op eq 'start') { + # startswith search push @query_parts, { wildcard => { "$wh.phrase" => lc "$val*" }}; } else { # regular wordlist stuff - # TODO truncation push @query_parts, { match => { $wh => $val }}; } } diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl index e90e34988c..1cc6cd5235 100755 --- a/opac/opac-authorities-home.pl +++ b/opac/opac-authorities-home.pl @@ -68,9 +68,9 @@ if ( $op eq "do_search" ) { # die Dumper(\@marclist, \@and_or, # \@excluding, \@operator, \@value, $authtypecode, $orderby, $query); # The searchengine API expects pages to start at page 1 - $startfrom = defined($startfrom) ? $startfrom+1 : undef; + $startfrom = $startfrom // 0; my ( $results, $total ) = - $searcher->search_auth_compat( $search_query, $startfrom, $resultsperpage ); + $searcher->search_auth_compat( $search_query, $startfrom+1, $resultsperpage ); ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "opac-authoritiessearchresultlist.tt", -- 2.39.5