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

(-)a/Koha/SearchEngine/Elasticsearch.pm (-8 / +11 lines)
Lines 520-526 sub _process_mappings { Link Here
520
            $nonfiling_chars = looks_like_number($nonfiling_chars) ? int($nonfiling_chars) : 0;
520
            $nonfiling_chars = looks_like_number($nonfiling_chars) ? int($nonfiling_chars) : 0;
521
            # Nonfiling chars does not make sense for multiple values
521
            # Nonfiling chars does not make sense for multiple values
522
            # Only apply on first element
522
            # Only apply on first element
523
            $values->[0] = substr $values->[0], $nonfiling_chars;
523
            if ( $nonfiling_chars > 0 ) {
524
                if ($sort) {
525
                    $values->[0] = substr $values->[0], $nonfiling_chars;
526
                } else {
527
                    push @{$values}, substr $values->[0], $nonfiling_chars;
528
                }
529
            }
524
        }
530
        }
525
531
526
        $values = [ grep(!/^$/, @{$values}) ];
532
        $values = [ grep(!/^$/, @{$values}) ];
Lines 1196-1207 sub _get_marc_mapping_rules { Link Here
1196
        foreach my $indicator (keys %title_fields) {
1202
        foreach my $indicator (keys %title_fields) {
1197
            foreach my $field_tag (@{$title_fields{$indicator}}) {
1203
            foreach my $field_tag (@{$title_fields{$indicator}}) {
1198
                my $mappings = $rules->{data_fields}->{$field_tag}->{subfields}->{a} // [];
1204
                my $mappings = $rules->{data_fields}->{$field_tag}->{subfields}->{a} // [];
1199
                foreach my $mapping (@{$mappings}) {
1205
                foreach my $mapping ( @{$mappings} ) {
1200
                    if ($mapping->[0] =~ /__sort$/) {
1206
                    # Mark this as to be processed for nonfiling characters indicator
1201
                        # Mark this as to be processed for nonfiling characters indicator
1207
                    # later on in _process_mappings
1202
                        # later on in _process_mappings
1208
                    $mapping->[1]->{nonfiling_characters_indicator} = $indicator;
1203
                        $mapping->[1]->{nonfiling_characters_indicator} = $indicator;
1204
                    }
1205
                }
1209
                }
1206
            }
1210
            }
1207
        }
1211
        }
1208
- 

Return to bug 36678