diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index e60f65d100..ff2fce8450 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -143,6 +143,12 @@
[% IF ( searchdesc ) %] [% IF ( total ) %] + [% IF quoted_hits %] +

+ No result(s) found for your original query: [% og_query %]
+ Your search was retried, quoted +

+ [% END %]

Your search returned [% total | html %] results. {$server}->{"hits"} // 0; - if ( $hits == 0 && $basic_search ) { + if ( $hits == 0 && $basic_search && $operands[0] !~ /^\".*\"$/ ) { + my $og_query = $query_desc; $operands[0] = '"' . $operands[0] . '"'; #quote it ## I. BUILD THE QUERY ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = @@ -654,6 +655,10 @@ for ( my $i = 0 ; $i < @servers ; $i++ ) { }; my $quoted_hits = $quoted_results_hashref->{$server}->{"hits"} // 0; if ($quoted_hits) { + $template->param( + quoted_hits => 1, + og_query => $og_query, + ); $results_hashref->{'biblioserver'} = $quoted_results_hashref->{'biblioserver'}; $hits = $quoted_hits; }