From 7c36e9a2e5dff2903dbdb34be59fb67a98fdde4b Mon Sep 17 00:00:00 2001
From: Nicolas Legrand <nicolas.legrand@bulac.fr>
Date: Mon, 23 Sep 2019 18:27:32 +0200
Subject: [PATCH] Bug 23670 Load Koha::Exceptions::ElasticSearch module in
 Koha::SearchEngine::Elasticsearch

Prevent Koha::SearchEngine::Elasticsearch from dying when trying to run
Koha::Exceptions::Elasticsearch::MARCFieldExprParseError->throw()

Plan test:

1. Go to Administration -> Searchengine configuration, and add a mapping
   for 995Z, whatever the search field (I did it with local-classification),
   save
2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
3. see it die asking for Koha::Exceptions::Elasticsearch
4. apply patch
5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
6. see it throw: Invalid MARC field expression: 995Z
---
 Koha/SearchEngine/Elasticsearch.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm
index 3104e2a..820f7f1 100644
--- a/Koha/SearchEngine/Elasticsearch.pm
+++ b/Koha/SearchEngine/Elasticsearch.pm
@@ -23,6 +23,7 @@ use C4::Context;
 
 use Koha::Database;
 use Koha::Exceptions::Config;
+use Koha::Exceptions::Elasticsearch;
 use Koha::SearchFields;
 use Koha::SearchMarcMaps;
 
-- 
2.1.4