Bug 12478: paging is fixed now too
authorRobin Sheat <robin@catalyst.net.nz>
Fri, 13 Mar 2015 02:27:24 +0000 (15:27 +1300)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 26 Apr 2016 20:20:05 +0000 (20:20 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
opac/opac-authorities-home.pl

index a30f5e1..62d0814 100644 (file)
@@ -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 }};
         }
     }
index e90e349..1cc6cd5 100755 (executable)
@@ -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",