Browse Source

Bug 14899: Add a reset option

For developpers only at the moment, if you want to reset your mappings,
you can hit:
  admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
16.11.x
Jonathan Druart 8 years ago
committed by Brendan Gallagher
parent
commit
bc41b29b64
  1. 9
      admin/searchengine/elasticsearch/mappings.pl

9
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;

Loading…
Cancel
Save