[Koha-bugs] [Bug 12586] Record matching rules - Required match checks doesn't work with MARCXML
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Jan 7 04:20:16 CET 2016
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12586
--- Comment #5 from David Cook <dcook at prosentient.com.au> ---
Comment on attachment 29948
--> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29948
Bug 12586 - Record matching rules - Required match checks doesn't work with
MARCXML
Review of attachment 29948:
--> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=12586&attachment=29948)
-----------------------------------------------------------------
I ran into this problem today and this is pretty much exactly what I had in
mind for a fix.
I've just added a couple comments about things to change.
Suggested test plan:
1) Create a bibliographic record with a control number of 123456
2) Create a matching rule with the following:
a) Search index "Control-number"
b) Score 100
c) Matchpoint components tag 001
d) Match check Source Tag 001
e) Match check Target Tag 001
3) Download the bibliographic from Step 1 as ISO MARC
4) Upload it via Stage Marc for Import, and use the record matching rule from
Step 2
Before applying patch:
5) Note that the no records match with your rule
Apply the patch:
6) Repeat Step 4 (ie upload using the matching rule from step 2)
7) Note that the record DOES match using the matching rule
::: C4/Matcher.pm
@@ +689,5 @@
> + foreach my $matched ( @{$searchresults} ) {
> + my $record = C4::Search::new_record_from_zebra( 'biblioserver', $matched );
> + $matches{$record}->{score} += $matchpoint->{'score'}; #Using $record HASH string representation as the key :)
> + $matches{$record}->{record} = $record;
> + }
This block all looks good.
@@ +704,1 @@
> keys %matches unless ($self->{'record_type'} eq 'auth');
There's no such record_type as 'auth'... this should be 'authority'. I know
it's not related to this bug per se, but may as well change it now.
@@ +711,4 @@
> my $record_number;
> my $result = C4::Biblio::TransformMarcToKoha(C4::Context->dbh, $target_record, '');
> $record_number = $result->{'biblionumber'};
> + push @results, { 'record_id' => $record_number, 'score' => $matches{$hashkey}->{score}, 'target_record' => $target_record, 'target_biblio' => $result };
Why have you included "target_record" and "target_biblio" here? This seems
unnecessary and is an addition to the original code. If it's being used
elsewhere, I think that should be separated into a separate patch.
@@ +760,4 @@
> }
>
> sub _passes_required_checks {
> + my ($source_record, $target_record, $matchchecks) = @_;
Looks good.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list