Bug 19581: Remove 'split' option from Catmandu fixes for marc

This option in combination with append seems to add null entries in the indexes
for fields that don't exist. These fields then affect sorting. Removing it solves
the issue

To test:
1 - Have an ES setup
2 - Catalog and index some records
3 - View a record in ES:
    curl 'localhost:9200/koha_kohadev_biblios/data/4?pretty=yes'
4 - Note there are 'null' entries in the indexes, save this result for
comparison
5 - Apply patch
6 - Reindex, amking sure to delete existing indexes
    perl misc/search_tools/rebuild_elastic_search.pl -d
7 - View the record again
8 - Note the null entries are removed
9 - Note indices are otherwise intact

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2017-11-05 01:51:39 +00:00
parent 16c6ff1e3c
commit 88e7fc2dab
1 changed files with 1 additions and 1 deletions

View File

@ -326,7 +326,7 @@ sub get_fixer_rules {
# selects a range
# 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';
$options = '' unless $marc_field =~ m|_/| || $type eq 'sum';
push @rules, "marc_map('$marc_field','${name}.\$append', $options)";
if ($facet) {
push @rules, "marc_map('$marc_field','${name}__facet.\$append', $options)";