add option to export and index xml to rebuild_zebra
Signed-off-by: Chris Cormack <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
c90af5d48b
commit
71dd69d5ac
1 changed files with 20 additions and 10 deletions
|
@ -28,6 +28,7 @@ my $noxml;
|
||||||
my $noshadow;
|
my $noshadow;
|
||||||
my $do_munge;
|
my $do_munge;
|
||||||
my $want_help;
|
my $want_help;
|
||||||
|
my $as_xml;
|
||||||
my $result = GetOptions(
|
my $result = GetOptions(
|
||||||
'd:s' => \$directory,
|
'd:s' => \$directory,
|
||||||
'reset' => \$reset,
|
'reset' => \$reset,
|
||||||
|
@ -39,6 +40,7 @@ my $result = GetOptions(
|
||||||
'munge-config' => \$do_munge,
|
'munge-config' => \$do_munge,
|
||||||
'a' => \$authorities,
|
'a' => \$authorities,
|
||||||
'h|help' => \$want_help,
|
'h|help' => \$want_help,
|
||||||
|
'x' => \$as_xml,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -365,11 +367,15 @@ if ($biblios) {
|
||||||
substr($leader,0,5)=' ';
|
substr($leader,0,5)=' ';
|
||||||
substr($leader,10,7)='22 ';
|
substr($leader,10,7)='22 ';
|
||||||
$record->leader(substr($leader,0,24));
|
$record->leader(substr($leader,0,24));
|
||||||
|
if($as_xml) {
|
||||||
|
print OUT $record->as_xml_record();
|
||||||
|
} else {
|
||||||
print OUT $record->as_usmarc();
|
print OUT $record->as_usmarc();
|
||||||
}
|
}
|
||||||
close(OUT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close(OUT);
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# and reindexing everything
|
# and reindexing everything
|
||||||
|
@ -377,9 +383,10 @@ if ($biblios) {
|
||||||
print "====================\n";
|
print "====================\n";
|
||||||
print "REINDEXING zebra\n";
|
print "REINDEXING zebra\n";
|
||||||
print "====================\n";
|
print "====================\n";
|
||||||
system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d biblios init") if ($reset);
|
my $record_fmt = ($as_xml) ? 'marcxml' : 'iso2709' ;
|
||||||
system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('biblioserver')->{config}." $noshadow -d biblios update $directory/biblios");
|
system("zebraidx -g $record_fmt -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d biblios init") if ($reset);
|
||||||
system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d biblios commit") unless $noshadow;
|
system("zebraidx -g $record_fmt -c ".C4::Context->zebraconfig('biblioserver')->{config}." $noshadow -d biblios update $directory/biblios");
|
||||||
|
system("zebraidx -g $record_fmt -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d biblios commit") unless $noshadow;
|
||||||
} else {
|
} else {
|
||||||
print "skipping biblios\n";
|
print "skipping biblios\n";
|
||||||
}
|
}
|
||||||
|
@ -442,6 +449,9 @@ Parameters:
|
||||||
option is recommended only
|
option is recommended only
|
||||||
for advanced user.
|
for advanced user.
|
||||||
|
|
||||||
|
-x export and index as xml instead of is02709 (biblios only).
|
||||||
|
use this if you might have records > 99,999 chars,
|
||||||
|
|
||||||
-w skip shadow indexing for this batch
|
-w skip shadow indexing for this batch
|
||||||
|
|
||||||
-munge-config Deprecated option to try
|
-munge-config Deprecated option to try
|
||||||
|
|
Loading…
Reference in a new issue