Lines 275-284
sub _elasticsearch_mapping_for_default {
Link Here
|
275 |
}; |
275 |
}; |
276 |
} |
276 |
} |
277 |
|
277 |
|
|
|
278 |
=head2 reset_elasticsearch_mappings |
279 |
|
280 |
Deletes all search mappings and adds the default search mappings |
281 |
|
282 |
=cut |
283 |
|
278 |
sub reset_elasticsearch_mappings { |
284 |
sub reset_elasticsearch_mappings { |
279 |
my $mappings_yaml = C4::Context->config('intranetdir') . '/admin/searchengine/elasticsearch/mappings.yaml'; |
285 |
my $mappings_yaml = C4::Context->config('intranetdir') . '/admin/searchengine/elasticsearch/mappings.yaml'; |
280 |
my $indexes = LoadFile( $mappings_yaml ); |
286 |
my $indexes = LoadFile( $mappings_yaml ); |
281 |
|
287 |
|
|
|
288 |
Koha::SearchMarcMaps->search->delete; |
282 |
while ( my ( $index_name, $fields ) = each %$indexes ) { |
289 |
while ( my ( $index_name, $fields ) = each %$indexes ) { |
283 |
while ( my ( $field_name, $data ) = each %$fields ) { |
290 |
while ( my ( $field_name, $data ) = each %$fields ) { |
284 |
my $field_type = $data->{type}; |
291 |
my $field_type = $data->{type}; |