From 3a0f05695f931a7dc86d6252c3a396988f1ba3e7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 24 Dec 2019 14:42:36 +0000 Subject: [PATCH] Bug 24109: Map 'loc' to 'location' whne building ES queries When building the query we start with mc-loc - then we strip the mc, convert the field, and restore mc- to indicate the searches should be ORed together. We have a mapping for mc-loc to location, but we strip the mc for converting For all other mc indexes there is no issue as they don't need to be mapped (they are the same minus the mc) To test: 0 - Be using Elasticsearch and have AdvancedSearchTypes set to include loc 1 - Perform an advanced search for two shelving locations that have items in the catalog 2 - Note no restuls 3 - Apply patch 4 - Restart all the things 5 - Repeat search 6 - You get results! --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index 05804e3640..3ab8deb0c7 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -703,6 +703,7 @@ our %index_field_convert = ( 'hi' => 'host-item-number', 'itu' => 'index-term-uncontrolled', 'itg' => 'index-term-genre', + 'loc' => 'location' ); my $field_name_pattern = '[\w\-]+'; my $multi_field_pattern = "(?:\\.$field_name_pattern)*"; -- 2.11.0