From 58efea02152e3c936316d6a95315523a9ab8eeeb Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Thu, 7 Feb 2008 12:59:04 -0600 Subject: [PATCH] Allow stage_biblios_file to take matcher id as parameter. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- misc/stage_biblios_file.pl | 19 +++++++++++++------ tools/manage-marc-import.pl | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/misc/stage_biblios_file.pl b/misc/stage_biblios_file.pl index a692748640..671bc86bd4 100755 --- a/misc/stage_biblios_file.pl +++ b/misc/stage_biblios_file.pl @@ -24,7 +24,7 @@ my $want_help = 0; my $result = GetOptions( 'file:s' => \$input_file, - 'match-bibs' => \$match_bibs, + 'match-bibs:s' => \$match_bibs, 'add-items' => \$add_items, 'comment:s' => \$batch_comment, 'h|help' => \$want_help @@ -70,11 +70,16 @@ sub process_batch { my $num_with_matches = 0; if ($match_bibs) { - my $matcher = C4::Matcher->new('biblio'); - $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, ''); - $matcher->add_simple_required_check('245', 'a', -1, 0, '', + my $matcher = C4::Matcher->fetch($match_bibs) ; + if( ! defined $matcher) { + $matcher = C4::Matcher->new('biblio'); + $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, ''); + $matcher->add_simple_required_check('245', 'a', -1, 0, '', '245', 'a', -1, 0, ''); - print "... looking for matches with records already in database\n"; + } else { + SetImportBatchMatcher($batch_id, $match_bibs); + } + print "... looking for matches with records already in database\n"; $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher, 10, 100, \&print_progress_and_commit); print "... finished looking for matches\n"; } @@ -125,9 +130,11 @@ records into the main Koha database. Parameters: --file name of input MARC bib file - --match-bibs use this option to match bibs + --match-bibs use this option to match bibs in the file with bibs already in the database for future overlay. + If isn't defined, a default + MARC21 ISBN & title match rule will be applied. --add-items use this option to specify that item data is embedded in the MARC bibs and should be parsed. diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index 3a7bd4e6b2..ec55233a41 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -44,7 +44,7 @@ my $import_batch_id = $input->param('import_batch_id'); # record list displays my $offset = $input->param('offset') || 0; -my $results_per_page = $input->param('results_per_page') || 10; +my $results_per_page = $input->param('results_per_page') || 25; my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "tools/manage-marc-import.tmpl", -- 2.39.5