|
Lines 24-29
my $directory;
Link Here
|
| 24 |
my $nosanitize; |
24 |
my $nosanitize; |
| 25 |
my $skip_export; |
25 |
my $skip_export; |
| 26 |
my $keep_export; |
26 |
my $keep_export; |
|
|
27 |
my $skip_index; |
| 27 |
my $reset; |
28 |
my $reset; |
| 28 |
my $biblios; |
29 |
my $biblios; |
| 29 |
my $authorities; |
30 |
my $authorities; |
|
Lines 44-49
my $result = GetOptions(
Link Here
|
| 44 |
'r|reset' => \$reset, |
45 |
'r|reset' => \$reset, |
| 45 |
's' => \$skip_export, |
46 |
's' => \$skip_export, |
| 46 |
'k' => \$keep_export, |
47 |
'k' => \$keep_export, |
|
|
48 |
'I|skip-index' => \$skip_index, |
| 47 |
'nosanitize' => \$nosanitize, |
49 |
'nosanitize' => \$nosanitize, |
| 48 |
'b' => \$biblios, |
50 |
'b' => \$biblios, |
| 49 |
'noxml' => \$noxml, |
51 |
'noxml' => \$noxml, |
|
Lines 134-146
if ($do_munge) {
Link Here
|
| 134 |
} |
136 |
} |
| 135 |
|
137 |
|
| 136 |
if ($authorities) { |
138 |
if ($authorities) { |
| 137 |
index_records('authority', $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $authorityserverdir); |
139 |
index_records('authority', $directory, $skip_export, $skip_index, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $authorityserverdir); |
| 138 |
} else { |
140 |
} else { |
| 139 |
print "skipping authorities\n" if ( $verbose_logging ); |
141 |
print "skipping authorities\n" if ( $verbose_logging ); |
| 140 |
} |
142 |
} |
| 141 |
|
143 |
|
| 142 |
if ($biblios) { |
144 |
if ($biblios) { |
| 143 |
index_records('biblio', $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $biblioserverdir); |
145 |
index_records('biblio', $directory, $skip_export, $skip_index, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $biblioserverdir); |
| 144 |
} else { |
146 |
} else { |
| 145 |
print "skipping biblios\n" if ( $verbose_logging ); |
147 |
print "skipping biblios\n" if ( $verbose_logging ); |
| 146 |
} |
148 |
} |
|
Lines 191-197
sub check_zebra_dirs {
Link Here
|
| 191 |
} # ---------- end of subroutine check_zebra_dirs ---------- |
193 |
} # ---------- end of subroutine check_zebra_dirs ---------- |
| 192 |
|
194 |
|
| 193 |
sub index_records { |
195 |
sub index_records { |
| 194 |
my ($record_type, $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $server_dir) = @_; |
196 |
my ($record_type, $directory, $skip_export, $skip_index, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $server_dir) = @_; |
| 195 |
|
197 |
|
| 196 |
my $num_records_exported = 0; |
198 |
my $num_records_exported = 0; |
| 197 |
my $records_deleted; |
199 |
my $records_deleted; |
|
Lines 230-253
sub index_records {
Link Here
|
| 230 |
} |
232 |
} |
| 231 |
} |
233 |
} |
| 232 |
} |
234 |
} |
| 233 |
|
235 |
|
| 234 |
# |
236 |
# |
| 235 |
# and reindexing everything |
237 |
# and reindexing everything |
| 236 |
# |
238 |
# |
| 237 |
if ( $verbose_logging ) { |
239 |
if ($skip_index) { |
| 238 |
print "====================\n"; |
240 |
if ($verbose_logging) { |
| 239 |
print "REINDEXING zebra\n"; |
241 |
print "====================\n"; |
| 240 |
print "====================\n"; |
242 |
print "SKIPPING $record_type indexing\n"; |
| 241 |
} |
243 |
print "====================\n"; |
| 242 |
my $record_fmt = ($as_xml) ? 'marcxml' : 'iso2709' ; |
244 |
} |
| 243 |
if ($process_zebraqueue) { |
|
|
| 244 |
do_indexing($record_type, 'delete', "$directory/del_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) |
| 245 |
if %$records_deleted; |
| 246 |
do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) |
| 247 |
if $num_records_exported; |
| 248 |
} else { |
245 |
} else { |
| 249 |
do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) |
246 |
if ( $verbose_logging ) { |
| 250 |
if ($num_records_exported or $skip_export); |
247 |
print "====================\n"; |
|
|
248 |
print "REINDEXING zebra\n"; |
| 249 |
print "====================\n"; |
| 250 |
} |
| 251 |
my $record_fmt = ($as_xml) ? 'marcxml' : 'iso2709' ; |
| 252 |
if ($process_zebraqueue) { |
| 253 |
do_indexing($record_type, 'delete', "$directory/del_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) |
| 254 |
if %$records_deleted; |
| 255 |
do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) |
| 256 |
if $num_records_exported; |
| 257 |
} else { |
| 258 |
do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) |
| 259 |
if ($num_records_exported or $skip_export); |
| 260 |
} |
| 251 |
} |
261 |
} |
| 252 |
} |
262 |
} |
| 253 |
|
263 |
|