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 <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2025-08-28 16:20:24 +00:00 committed by Lucas Gass
parent 4cadd40278
commit deb11ee1c8
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}