X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FMatcher.pm;h=8caab0a39cdf7b77d3f20826ba2910e05dfb7ec1;hb=4458ac5764126049d95e115adeacd1f335efdb8f;hp=5c27fa361517637daaa9b5394cc257ead9108ba6;hpb=ed4b60fa1dca40d0d0bcf4880fd5f2892a15f90f;p=koha_fer diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 5c27fa3615..8caab0a39c 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -633,9 +633,14 @@ sub get_matches { next if scalar(@source_keys) == 0; + # FIXME - because of a bug in QueryParser, an expression ofthe + # format 'isbn:"isbn1" || isbn:"isbn2" || isbn"isbn3"...' + # does not get parsed correctly, so we will not + # do AggressiveMatchOnISBN if UseQueryParser is on @source_keys = C4::Koha::GetVariationsOfISBNs(@source_keys) - if ( $matchpoint->{index} eq 'isbn' - && C4::Context->preference('AggressiveMatchOnISBN') ); + if ( $matchpoint->{index} =~ /^isbn$/i + && C4::Context->preference('AggressiveMatchOnISBN') ) + && !C4::Context->preference('UseQueryParser'); # build query my $query; @@ -643,13 +648,13 @@ sub get_matches { my $searchresults; my $total_hits; if ( $self->{'record_type'} eq 'biblio' ) { - my $phr = C4::Context->preference('AggressiveMatchOnISBN') ? ',phr' : q{}; if ($QParser) { $query = join( " || ", - map { "$matchpoint->{'index'}$phr:$_" } @source_keys ); + map { "$matchpoint->{'index'}:$_" } @source_keys ); } else { + my $phr = C4::Context->preference('AggressiveMatchOnISBN') ? ',phr' : q{}; $query = join( " or ", map { "$matchpoint->{'index'}$phr=$_" } @source_keys ); }