Same as Load, but for Dump.
Test plan:
Edit ES mappings, replace withdrawn's label with "withdrawn ✔️ ❤️ ★"
Export the mappings
perl misc/search_tools/export_elasticsearch_mappings.pl > admin/searchengine/elasticsearch/mappings.yaml
Reset mappings from the UI
=> Notice that the label is correct
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
use MARC::Record;
use MARC::Batch;
use MARC::Charset;
+use Encode;
use Koha::Script;
use C4::Context;
}
if ($yamlfile) {
open my $yamlfileout, q{>}, "$yamlfile" or die "cannot open $yamlfile \n";
- print $yamlfileout YAML::XS::Dump($yamlhash);
+ print $yamlfileout YAML::XS::Dump(Encode::decode_utf8($yamlhash));
}
exit 0;
if ($authtypes){
$headingfields = YAML::XS::LoadFile($authtypes);
$headingfields={C4::Context->preference('marcflavour')=>$headingfields};
- $debug && warn YAML::XS::Dump($headingfields);
+ $debug && warn YAML::XS::Dump(Encode::decode_utf8($headingfields));
}
unless ($headingfields){
$headingfields=$dbh->selectall_hashref("SELECT auth_tag_to_report, authtypecode from auth_types",'auth_tag_to_report',{Slice=>{}});
=cut
use Modern::Perl;
+use Encode;
use Koha::Script;
use Koha::Database;
my $mappings = Koha::SearchEngine::Elasticsearch::raw_elasticsearch_mappings( $type );
binmode STDOUT, ":encoding(UTF-8)";
-print YAML::XS::Dump($mappings);
+print Encode::decode_utf8( YAML::XS::Dump($mappings) );
my @sqlorparams;
my @sqlor;
my @sqlwhere;
- ($debug) and print STDERR YAML::XS::Dump($filters_hashref);
foreach my $filter (keys %$filters_hashref){
my $string;
my $stringfield=$filter;