View | Details | Raw Unified | Return to bug 19581
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch.pm (-12 / +5 lines)
Lines 323-342 sub get_fixer_rules { Link Here
323
        sub {
323
        sub {
324
            my ( $name, $type, $facet, $suggestible, $sort, $marc_type, $marc_field ) = @_;
324
            my ( $name, $type, $facet, $suggestible, $sort, $marc_type, $marc_field ) = @_;
325
            return if $marc_type ne $marcflavour;
325
            return if $marc_type ne $marcflavour;
326
            my $options = '';
326
327
327
            push @rules, "marc_map('$marc_field','${name}.\$append', '')";
328
            # There's a bug when using 'split' with something that
329
            # selects a range
330
            # The split makes everything into nested arrays, but that's not
331
            # really a big deal, ES doesn't mind.
332
            $options = '' unless $marc_field =~ m|_/| || $type eq 'sum';
333
            push @rules, "marc_map('$marc_field','${name}.\$append', $options)";
334
            if ($facet) {
328
            if ($facet) {
335
                push @rules, "marc_map('$marc_field','${name}__facet.\$append', $options)";
329
                push @rules, "marc_map('$marc_field','${name}__facet.\$append', '')";
336
            }
330
            }
337
            if ($suggestible) {
331
            if ($suggestible) {
338
                push @rules,
332
                push @rules,
339
                    #"marc_map('$marc_field','${name}__suggestion.input.\$append', $options)"; #must not have nested data structures in .input
333
                    #"marc_map('$marc_field','${name}__suggestion.input.\$append', '')"; #must not have nested data structures in .input
340
                    "marc_map('$marc_field','${name}__suggestion.input.\$append')";
334
                    "marc_map('$marc_field','${name}__suggestion.input.\$append')";
341
            }
335
            }
342
            if ( $type eq 'boolean' ) {
336
            if ( $type eq 'boolean' ) {
Lines 351-357 sub get_fixer_rules { Link Here
351
            }
345
            }
352
            if ($self->sort_fields()->{$name}) {
346
            if ($self->sort_fields()->{$name}) {
353
                if ($sort || !defined $sort) {
347
                if ($sort || !defined $sort) {
354
                    push @rules, "marc_map('$marc_field','${name}__sort.\$append', $options)";
348
                    push @rules, "marc_map('$marc_field','${name}__sort.\$append', '')";
355
                }
349
                }
356
            }
350
            }
357
        }
351
        }
358
- 

Return to bug 19581