From be42262424fb1eea483e242926e037ab4e23846a Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Tue, 11 Sep 2018 15:47:09 +0000 Subject: [PATCH] Bug 21331: Elasticsearch - fix indexing of concatenated subfields Signed-off-by: Martin Renvoize --- Koha/SearchEngine/Elasticsearch.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 9c114fb060..58c5e62ea4 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -292,16 +292,15 @@ sub get_fixer_rules { sub { my ( $name, $type, $facet, $suggestible, $sort, $marc_type, $marc_field ) = @_; return if $marc_type ne $marcflavour; - my $options =''; - push @rules, "marc_map('$marc_field','${name}.\$append', $options)"; + push @rules, "marc_map('$marc_field','${name}.\$append', pluck:0, join:' ')"; if ($facet) { - push @rules, "marc_map('$marc_field','${name}__facet.\$append', $options)"; + push @rules, "marc_map('$marc_field','${name}__facet.\$append', pluck:0, join:' ')"; } if ($suggestible) { push @rules, #"marc_map('$marc_field','${name}__suggestion.input.\$append', '')"; #must not have nested data structures in .input - "marc_map('$marc_field','${name}__suggestion.input.\$append')"; + "marc_map('$marc_field','${name}__suggestion.input.\$append', pluck:0, join:' ')"; } if ( $type eq 'boolean' ) { @@ -315,7 +314,7 @@ sub get_fixer_rules { } if ($self->sort_fields()->{$name}) { if ($sort || !defined $sort) { - push @rules, "marc_map('$marc_field','${name}__sort.\$append', $options)"; + push @rules, "marc_map('$marc_field','${name}__sort.\$append', pluck:0, join:' ')"; } } } -- 2.19.0