From c44b448ca403059500045d656d0d90ebfd3c673c 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 a556e4ec38..7ea63b0108 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' => lc $search->{authtypecode} } }; } my %s; -- 2.11.0