@@ -, +, @@ perl misc/z3950_responder.pl --config-dir /kohadevbox/koha/etc/z3950 --debug yaz-client localhost:2100 do a catalogue Z39.50 search. Don't forget to search in the keywords field. Not the title field. --- Koha/Z3950Responder/RPN.pm | 13 +++++++++---- etc/z3950/attribute_mappings.yaml | 2 -- 2 files changed, 9 insertions(+), 6 deletions(-) --- a/Koha/Z3950Responder/RPN.pm +++ a/Koha/Z3950Responder/RPN.pm @@ -40,7 +40,7 @@ sub to_koha { my ($self, $mappings) = @_; my $attrs = $self->{'attributes'}; - my $fields = $mappings->{use}{default} // '_all'; + my $fields = $mappings->{use}{default}; my $split = 0; my $prefix = ''; my $suffix = ''; @@ -62,7 +62,7 @@ sub to_koha { } } - $fields = [$fields] unless ref($fields) eq 'ARRAY'; + $fields = [$fields] unless !defined $fields || ref($fields) eq 'ARRAY'; if ($split) { my @terms; @@ -72,8 +72,12 @@ sub to_koha { next if (!$word); $word = $self->escape($word); my @words; - foreach my $field (@{$fields}) { - push(@words, "$field:($prefix$word$suffix)"); + if( $fields ) { + foreach my $field (@{$fields}) { + push(@words, "$field:($prefix$word$suffix)"); + } + } else { + push(@words, "($prefix$word$suffix)"); } push (@terms, join(' OR ', @words)); } @@ -82,6 +86,7 @@ sub to_koha { my @terms; $term = $self->escape($term); + return ("($prefix$term$suffix)") unless $fields; foreach my $field (@{$fields}) { push(@terms, "$field:($prefix$term$suffix)"); } --- a/etc/z3950/attribute_mappings.yaml +++ a/etc/z3950/attribute_mappings.yaml @@ -8,7 +8,6 @@ authorities: 3: Heading 9: LC-card-number 12: Local-number - default: _all biblios: # BIB-1 use attributes to index fields use: @@ -43,4 +42,3 @@ biblios: 1031: itype 1033: Host-Item-Number 1045: control-number - default: _all --