Bugzilla – Attachment 18639 Details for
Bug 10399
rebuild_zebra.pl should reset the indexes with -r even if zebraqueue empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10399 - rebuild_zebra.pl should reset the indexes with -r even if zebraqueue empty
Bug-10399---rebuildzebrapl-should-reset-the-indexe.patch (text/plain), 2.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-06-04 13:22:01 UTC
(
hide
)
Description:
Bug 10399 - rebuild_zebra.pl should reset the indexes with -r even if zebraqueue empty
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-06-04 13:22:01 UTC
Size:
2.13 KB
patch
obsolete
>From 160df2006a205de708b98500559ef25e114c3183 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 4 Jun 2013 10:11:02 -0300 >Subject: [PATCH] Bug 10399 - rebuild_zebra.pl should reset the indexes with -r > even if zebraqueue empty > >This patch add the reset_indexes sub to the rebuild_zebra.pl script. And changes >the scripts' logic to run it in case -r was passed and there are no records pending >on the zebraqueue table. > >Regards >To+ >--- > misc/migration_tools/rebuild_zebra.pl | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > >diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl >index a46526d..b5e2063 100755 >--- a/misc/migration_tools/rebuild_zebra.pl >+++ b/misc/migration_tools/rebuild_zebra.pl >@@ -271,9 +271,12 @@ sub index_records { > if %$records_deleted; > do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) > if $num_records_exported; >+ } elsif ($num_records_exported or $skip_export) { >+ do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt); > } else { >- do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt) >- if ($num_records_exported or $skip_export); >+ if ( $reset ) { >+ reset_index($record_type, $record_fmt, $zebraidx_log_opt); >+ } > } > } > } >@@ -679,6 +682,19 @@ sub do_indexing { > > } > >+sub reset_indexes { >+ >+ my ($record_type, $record_format, $zebraidx_log_opt) = @_; >+ >+ my $zebra_server = ($record_type eq 'biblio') ? 'biblioserver' : 'authorityserver'; >+ my $zebra_db_name = ($record_type eq 'biblio') ? 'biblios' : 'authorities'; >+ my $zebra_config = C4::Context->zebraconfig($zebra_server)->{'config'}; >+ >+ system("zebraidx -c $zebra_config $zebraidx_log_opt -g $record_format -d $zebra_db_name init"); >+ >+} >+ >+ > sub print_usage { > print <<_USAGE_; > $0: reindex MARC bibs and/or authorities in Zebra. >-- >1.8.1.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10399
: 18639