Bug 18434: Elasticsearch indexing broken with newer catmandu version
authorNick Clemens <nick@bywatersolutions.com>
Fri, 14 Apr 2017 14:03:11 +0000 (10:03 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 Jul 2017 17:29:02 +0000 (14:29 -0300)
To test:
1 - Make sure you have latest koha deps, catmandu versions should be:
    libcatmandu-marc-perl   1.09-1~kohadev1
    libcatmandu-perl        1.0304-2~kohadev1
2 - Reindex elastic
3 - Try searching and likely notice odd results
4 - Try:
curl -XGET
'http://localhost:9200/koha_kohadev_biblios/data/792?pretty=true'
with a known biblionumber and notice some null fields
5 - Apply patch
6 - Reindex
7 - Note fields are populated and search works as expected

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/SearchEngine/Elasticsearch.pm

index 1fd8bc1..b079dca 100644 (file)
@@ -326,7 +326,7 @@ sub get_fixer_rules {
             # The split makes everything into nested arrays, but that's not
             # really a big deal, ES doesn't mind.
             $options = '-split => 1' unless $marc_field =~ m|_/| || $type eq 'sum';
-            push @rules, "marc_map('$marc_field','${name}', $options)";
+            push @rules, "marc_map('$marc_field','${name}.\$append', $options)";
             if ($facet) {
                 push @rules, "marc_map('$marc_field','${name}__facet', $options)";
             }