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