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

(-)a/Koha/Z3950Responder/RPN.pm (-4 / +9 lines)
Lines 40-46 sub to_koha { Link Here
40
    my ($self, $mappings) = @_;
40
    my ($self, $mappings) = @_;
41
41
42
    my $attrs = $self->{'attributes'};
42
    my $attrs = $self->{'attributes'};
43
    my $fields = $mappings->{use}{default} // '_all';
43
    my $fields = $mappings->{use}{default};
44
    my $split = 0;
44
    my $split = 0;
45
    my $prefix = '';
45
    my $prefix = '';
46
    my $suffix = '';
46
    my $suffix = '';
Lines 62-68 sub to_koha { Link Here
62
        }
62
        }
63
    }
63
    }
64
64
65
    $fields = [$fields] unless ref($fields) eq 'ARRAY';
65
    $fields = [$fields] unless !defined $fields || ref($fields) eq 'ARRAY';
66
66
67
    if ($split) {
67
    if ($split) {
68
        my @terms;
68
        my @terms;
Lines 72-79 sub to_koha { Link Here
72
            next if (!$word);
72
            next if (!$word);
73
            $word = $self->escape($word);
73
            $word = $self->escape($word);
74
            my @words;
74
            my @words;
75
            foreach my $field (@{$fields}) {
75
            if( $fields ) {
76
                push(@words, "$field:($prefix$word$suffix)");
76
                foreach my $field (@{$fields}) {
77
                    push(@words, "$field:($prefix$word$suffix)");
78
                }
79
            } else {
80
                push(@words, "($prefix$word$suffix)");
77
            }
81
            }
78
            push (@terms, join(' OR ', @words));
82
            push (@terms, join(' OR ', @words));
79
        }
83
        }
Lines 82-87 sub to_koha { Link Here
82
86
83
    my @terms;
87
    my @terms;
84
    $term = $self->escape($term);
88
    $term = $self->escape($term);
89
    return "($prefix$term$suffix)" unless $fields;
85
    foreach my $field (@{$fields}) {
90
    foreach my $field (@{$fields}) {
86
        push(@terms, "$field:($prefix$term$suffix)");
91
        push(@terms, "$field:($prefix$term$suffix)");
87
    }
92
    }
(-)a/etc/z3950/attribute_mappings.yaml (-3 lines)
Lines 8-14 authorities: Link Here
8
        3: Heading
8
        3: Heading
9
        9: LC-card-number
9
        9: LC-card-number
10
        12: Local-number
10
        12: Local-number
11
        default: _all
12
biblios:
11
biblios:
13
    # BIB-1 use attributes to index fields
12
    # BIB-1 use attributes to index fields
14
    use:
13
    use:
Lines 43-46 biblios: Link Here
43
        1031: itype
42
        1031: itype
44
        1033: Host-Item-Number
43
        1033: Host-Item-Number
45
        1045: control-number
44
        1045: control-number
46
        default: _all
47
- 

Return to bug 25277