X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FMatcher.pm;h=59b5876c2ac6f9d51ddb26e61351fc36da628284;hb=2a8e610de75e7c9176d9cd5c0fdda4753141bcfc;hp=3f44783ca1fbf32e2040ddf38d2f68986c608259;hpb=4370a19d75e2824d71946898d0876fb899199e52;p=koha_fer diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 3f44783ca1..59b5876c2a 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -29,7 +29,7 @@ use vars qw($VERSION); BEGIN { # set the version for version checking - $VERSION = 3.01; + $VERSION = 3.07.00.049; } =head1 NAME @@ -95,6 +95,22 @@ sub GetMatcherList { return @results; } +=head2 GetMatcherId + + my $matcher_id = C4::Matcher::GetMatcherId($code); + +Returns the matcher_id of a code. + +=cut + +sub GetMatcherId { + my ($code) = @_; + my $dbh = C4::Context->dbh; + + my $matcher_id = $dbh->selectrow_array("SELECT matcher_id FROM marc_matchers WHERE code = ?", undef, $code); + return $matcher_id; +} + =head1 METHODS =head2 new @@ -606,9 +622,12 @@ sub get_matches { # FIXME only searching biblio index at the moment my ($error, $searchresults, $total_hits) = SimpleSearch($query, 0, $max_matches); - warn "search failed ($query) $error" if $error; - foreach my $matched (@$searchresults) { - $matches{$matched} += $matchpoint->{'score'}; + if (defined $error ) { + warn "search failed ($query) $error"; + } else { + foreach my $matched (@{$searchresults}) { + $matches{$matched} += $matchpoint->{'score'}; + } } } @@ -769,7 +788,7 @@ __END__ =head1 AUTHOR -Koha Development Team +Koha Development Team Galen Charlton