From 7768d48d7c0e75d24517d2de4a68d90fa2b2c936 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 18 Dec 2019 14:12:16 +0000 Subject: [PATCH] Bug 24264: Use raw field when limiting by authtype To test: 1 - Have a genre form record in your authorities file 2 - Search authorities for 'Default' 3 - The result is returned 4 - Set the dropdown to 'Genre/Form' and search matchign term 5 - No results 6 - Apply patch 7 - Restart all the things 8 - Repeat search for 'Genre/Form' and search matching term 9 - Record is returned --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index e744961df4..0aa8317b63 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -358,7 +358,7 @@ sub build_authorities_query { } }; if ( $search->{authtypecode} ) { - $query->{query}->{bool}->{filter} = { term => { 'authtype' => lc $search->{authtypecode} } }; + $query->{query}->{bool}->{filter} = { term => { 'authtype.raw' => $search->{authtypecode} } }; } my %s; -- 2.11.0