From: Bill Erickson Date: Wed, 12 Feb 2014 15:18:39 +0000 (-0500) Subject: LP#1279998 marc_stream_importer support alternate match strategies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1e3e3e79ab7b5dcf62562b68f6ae398e37d96c88;p=evergreen%2Fpines.git LP#1279998 marc_stream_importer support alternate match strategies Adds support for sending auto-overlay-1match and auto-overlay-best-match in addition to auto-overlay-exact to Vandelay when performing the import. If no strategy is chosen, the script still defaults to auto-overlay-exact. These changes are managed with 3 new command line options: --auto-overlay-exact --auto-overlay-1match --auto-overlay-best-match Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl index d28850426a..bdb740bac5 100755 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl @@ -54,7 +54,10 @@ my %defaults = ( 'noqueue' => 0, 'nodaemon' => 0, 'wait=i' => 5, - 'import-by-queue' => 0 + 'import-by-queue' => 0, + 'auto-overlay-exact' => 0, + 'auto-overlay-1match' => 0, + 'auto-overlay-best-match' => 0 ); $OpenILS::Utils::Cronscript::debug=1 if $debug; @@ -250,11 +253,15 @@ sub process_spool { # filename sub bib_queue_import { my $rec_ids = shift; - my $extra = { - auto_overlay_exact => 1, - import_no_match => 1, - }; + my $extra = {import_no_match => 1}; $extra->{merge_profile} = $merge_profile if $merge_profile; + $extra->{auto_overlay_1match} = 1 if $real_opts->{'auto-overlay-1match'}; + $extra->{auto_overlay_best_match} = 1 if $real_opts->{'auto-overlay-best-match'}; + + # default to exact match if no strategy is chosen + $extra->{auto_overlay_exact} = 1 + if $real_opts->{'auto-overlay-exact'} or + not ($extra->{auto_overlay_1match} or $extra->{auto_overlay_best_match}); my $req; my @cleanup_recs;