From 122b28bbfe40c1f75c10788fe9c3d739eaa2e302 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 28 Aug 2025 16:20:24 +0000 Subject: [PATCH] Bug 40722: Add a log when resetting mappings during elastic rebuild The command currently logs when deleting indexes and indexing records, it would be helpful to have a log when resetting the mappings, and to log which mapping file has been used. To test: 1 - perl misc/search_tools/rebuild_elasticsearch.pl -r 2 - No log of reset 3 - Apply patch 4 - perl misc/search_tools/rebuild_elasticsearch.pl -r 5 - Note reset is logged Signed-off-by: Nick Clemens --- misc/search_tools/rebuild_elasticsearch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl index 43dc6452e22..5198fe1c8fa 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/misc/search_tools/rebuild_elasticsearch.pl @@ -169,6 +169,9 @@ pod2usage( -exitstatus => 0, -verbose => 2 ) if $man; _sanity_check(); if ($reset) { + my $mappings_yaml = C4::Context->config('elasticsearch_index_mappings'); + $mappings_yaml ||= C4::Context->config('intranetdir') . '/admin/searchengine/elasticsearch/mappings.yaml'; + _log( 1, "Resetting mappings from $mappings_yaml\n" ); Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; $delete = 1; } -- 2.39.5