3 # This inserts records from a Koha database into elastic search
5 # Copyright 2014 Catalyst IT
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 3 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with Koha; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 export_elasticsearch_mappings.pl - export search_marc_map, search_marc_to_field and search_field tables to YAML
28 B<export_elasticsearch_mappings.pl>
34 Export search_marc_map, search_marc_to_field and search_field tables to YAML.
40 =item B<-t|--type>=C<marc21|unimarc|normarc>
42 Only export a specific marc type. All if empty.
57 use Koha::SearchFields;
58 use Koha::SearchMarcMaps;
59 use Koha::SearchEngine::Elasticsearch;
73 pod2usage( -exitstatus => 0, -verbose => 2 ) if $man;
75 if ( $type && $type !~ /^(marc21|unimarc|normarc)$/ ) {
76 print "Bad marc type provided.\n";
80 my $mappings = Koha::SearchEngine::Elasticsearch::raw_elasticsearch_mappings( $type );
82 print Dump($mappings);