Bugzilla – Attachment 34891 Details for
Bug 12368
Rebuild Zebra improvement: allow to specify a DB table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12368: Rebuild Zebra improvement: allow to specify a DB table
PASSED-QA-Bug-12368-Rebuild-Zebra-improvement-allo.patch (text/plain), 2.82 KB, created by
Kyle M Hall (khall)
on 2015-01-02 15:18:59 UTC
(
hide
)
Description:
[PASSED QA] Bug 12368: Rebuild Zebra improvement: allow to specify a DB table
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-01-02 15:18:59 UTC
Size:
2.82 KB
patch
obsolete
>From 63caec45549af7c5a3fc072541a4ce1b96556983 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 4 Jun 2014 17:03:51 +0200 >Subject: [PATCH] [PASSED QA] Bug 12368: Rebuild Zebra improvement: allow to specify a DB table > >Currently the --where parameter only allow to specify a condition on >fields in the biblioitems table. >For some needs it would be great to specify a condition on the field in >the items table. > >The use case is the following: you want to reindex biblios with items >modified since a specific timestamp. > >Test plan: >1/ Pick an item randomly in your catalogue >2/ Edit it and save >3/ Note that the items.timestamp has been set to today but not the >biblioitems.timestamp >4/ launch rebuild_zebra without the new parameter > perl misc/migration_tools/rebuild_zebra.pl -b -v --where > "timestamp >= XXX" >where XXX is the today date (e.g. "2014-06-05 00:00:00"). >Note that the biblio has not been indexed. >5/ launch rebuild_zebra using the new parameter: > perl misc/migration_tools/rebuild_zebra.pl -b -v -t items --where > "timestamp >= XXX" >Note the biblio has been indexed. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/migration_tools/rebuild_zebra.pl | 10 +++++++++- > 1 files changed, 9 insertions(+), 1 deletions(-) > >diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl >index aa31cb2..67b73c7 100755 >--- a/misc/migration_tools/rebuild_zebra.pl >+++ b/misc/migration_tools/rebuild_zebra.pl >@@ -48,6 +48,7 @@ my $run_as_root; > my $run_user = (getpwuid($<))[0]; > my $wait_for_lock = 0; > my $use_flock; >+my $table = 'biblioitems'; > > my $verbose_logging = 0; > my $zebraidx_log_opt = " -v none,fatal,warn "; >@@ -75,6 +76,7 @@ my $result = GetOptions( > 'v+' => \$verbose_logging, > 'run-as-root' => \$run_as_root, > 'wait-for-lock' => \$wait_for_lock, >+ 't|table:s' => \$table, > ); > > if (not $result or $want_help) { >@@ -442,7 +444,10 @@ sub select_all_authorities { > } > > sub select_all_biblios { >- my $strsth = qq{ SELECT biblionumber FROM biblioitems }; >+ $table = 'biblioitems' >+ if $table ne 'items' >+ and $table ne 'biblio'; >+ my $strsth = qq{ SELECT biblionumber FROM $table }; > $strsth.=qq{ WHERE $where } if ($where); > $strsth.=qq{ LIMIT $length } if ($length && !$offset); > $strsth.=qq{ LIMIT $offset,$length } if ($offset); >@@ -918,6 +923,9 @@ Parameters: > to wait for the lock to free and then continue > processing the rebuild request, > >+ --table specify a table (can be items, biblioitems or biblio) to retrieve biblionumber to index. >+ biblioitems is the default value. >+ > --help or -h show this message. > _USAGE_ > } >-- >1.7.2.5
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 12368
:
28672
|
28793
|
34749
|
34750
| 34891 |
34892