diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 25536c8ce9..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} =~ /^isbn$/i - && C4::Context->preference('AggressiveMatchOnISBN') ); + && 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 ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index a52180f799..1b8cce5ef8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -198,4 +198,4 @@ Cataloging: choices: yes: "do" no: "don't" - - attempt to match aggressively by trying all variations of the ISBNs in the imported record as a phrase in the ISBN fields of already cataloged records. + - attempt to match aggressively by trying all variations of the ISBNs in the imported record as a phrase in the ISBN fields of already cataloged records. Note that this preference has no effect if UseQueryParser is on.