diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl index 5f7712d2a0..7d63002919 100755 --- a/admin/searchengine/elasticsearch/mappings.pl +++ b/admin/searchengine/elasticsearch/mappings.pl @@ -21,6 +21,7 @@ use C4::Koha; use C4::Output; use C4::Auth; +use Koha::SearchEngine::Elasticsearch; use Koha::SearchMarcMaps; use Koha::SearchFields; @@ -96,6 +97,14 @@ if ( $op eq 'edit' ) { $schema->storage->txn_commit; } } +elsif( $op eq 'reset' ) { + # TODO Move this feature to the interface + my $sure = $input->param('i_know_what_i_am_doing'); + if ( $sure ) { + Koha::SearchMarcMaps->search->delete; + Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; + } +} my @indexes;