From c4b0a839c7f0942b121985e66d4f86db8f16248c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 28 Apr 2022 13:25:15 +0000 Subject: [PATCH] Bug 30641: Quote authority id search --- Koha/Authorities.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Authorities.pm b/Koha/Authorities.pm index a509b75fa2..b2947644a6 100644 --- a/Koha/Authorities.pm +++ b/Koha/Authorities.pm @@ -51,7 +51,8 @@ sub get_usage_count { my $authid = $params->{authid} || return; my $searcher = Koha::SearchEngine::Search->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); - my ( $err, $result, $count ) = $searcher->simple_search_compat( 'an:' . $authid, 0, 0 ); + my ( $err, $result, $count ) = $searcher->simple_search_compat( 'an:"' . $authid.'"', 0, 0 ); + # We quote the search to prevent truncation finding partial matches if( $err ) { warn "Error: $err from search for " . $authid; return; -- 2.30.2