View | Details | Raw Unified | Return to bug 10399
Collapse All | Expand All

(-)a/misc/migration_tools/rebuild_zebra.pl (-3 / +18 lines)
Lines 271-279 sub index_records { Link Here
271
                if %$records_deleted;
271
                if %$records_deleted;
272
            do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
272
            do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
273
                if $num_records_exported;
273
                if $num_records_exported;
274
        } elsif ($num_records_exported or $skip_export) {
275
            do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt);
274
        } else {
276
        } else {
275
            do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
277
            if ( $reset ) {
276
                if ($num_records_exported or $skip_export);
278
                reset_index($record_type, $record_fmt, $zebraidx_log_opt);
279
            }
277
        }
280
        }
278
    }
281
    }
279
}
282
}
Lines 679-684 sub do_indexing { Link Here
679
682
680
}
683
}
681
684
685
sub reset_indexes {
686
687
    my ($record_type, $record_format, $zebraidx_log_opt) = @_;
688
689
    my $zebra_server  = ($record_type eq 'biblio') ? 'biblioserver' : 'authorityserver';
690
    my $zebra_db_name = ($record_type eq 'biblio') ? 'biblios' : 'authorities';
691
    my $zebra_config  = C4::Context->zebraconfig($zebra_server)->{'config'};
692
693
    system("zebraidx -c $zebra_config $zebraidx_log_opt -g $record_format -d $zebra_db_name init");
694
695
}
696
697
682
sub print_usage {
698
sub print_usage {
683
    print <<_USAGE_;
699
    print <<_USAGE_;
684
$0: reindex MARC bibs and/or authorities in Zebra.
700
$0: reindex MARC bibs and/or authorities in Zebra.
685
- 

Return to bug 10399