Bug 9286 - Add script to add a bib to the zebra queue from the command line
Summary: Add script to add a bib to the zebra queue from the command line
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-14 12:30 UTC by Kyle M Hall
Modified: 2014-12-07 20:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9286 - Add script to add a bib to the zebra queue from the command line (2.18 KB, patch)
2012-12-14 12:30 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9286 - Add script to add a bib to the zebra queue from the command line (1.54 KB, patch)
2012-12-17 18:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9286 - Add script to add a bib to the zebra queue from the command line (2.63 KB, patch)
2013-02-06 17:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9286 - Add script to add a bib to the zebra queue from the command line (2.76 KB, patch)
2013-02-06 17:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9286 - Add script to add a bib to the zebra queue from the command line (2.77 KB, patch)
2013-02-11 14:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9286 - Add script to add a bib to the zebra queue from the command line (2.78 KB, patch)
2013-02-11 14:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 9286 - Add script to add a bib to the zebra queue from the command line (2.93 KB, patch)
2013-02-19 01:57 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 9286 - Add script to add a bib to the zebra queue from the command line (3.35 KB, patch)
2013-05-27 08:12 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2012-12-14 12:30:26 UTC
It would be convenient to have a script to insert a single bib into the zebra queue manually.
Comment 1 Kyle M Hall 2012-12-14 12:30:57 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2012-12-14 15:52:20 UTC
The new script works well, but I have 2 remarks:
  1. 'eXecute' flag is not set
  2. if called without arguments, biblio id 0 is added to the zebraqueue. Even if it's managed well by rebuild_zebra.pl, I think this should be prevented and calling mod_zebraqueue.pl without arguments should print the help.

Marking as failed qa for (2)
Comment 3 Kyle M Hall 2012-12-17 18:19:57 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2012-12-17 18:21:00 UTC
Good catch!
Comment 5 Galen Charlton 2013-02-06 17:01:07 UTC
Works for me, but if we're going to have such a utility, we should cover all of the obvious use cases.  In particular, I suggest adding a -a/--authority/--authoritynumber flag.

Setting to "in discussion".
Comment 6 Galen Charlton 2013-02-06 17:02:26 UTC
Also, even for something as small as this, the GPL verbiage should be added to the header.
Comment 7 Kyle M Hall 2013-02-06 17:42:32 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2013-02-06 17:44:53 UTC Comment hidden (obsolete)
Comment 9 Galen Charlton 2013-02-06 23:18:05 UTC
Two issues with the latest patch:

[1] If you run it with just the -a option to index a single authority, it instead prints the help and exists.  There's no reason to require that -b be supplied; either -b or -a (or both) is sufficient.

[2] Help includes the string "--verbosep", which should just be "--verbose"
Comment 10 Kyle M Hall 2013-02-11 14:37:39 UTC Comment hidden (obsolete)
Comment 11 Kyle M Hall 2013-02-11 14:41:04 UTC Comment hidden (obsolete)
Comment 12 Bernardo Gonzalez Kriegel 2013-02-19 01:57:15 UTC Comment hidden (obsolete)
Comment 13 Chris Cormack 2013-05-27 08:09:54 UTC
 misc/mod_zebraqueue.pl -a 1

 select * from zebraqueue where done=0;
+----+--------------------+---------------+-----------------+------+---------------------+
| id | biblio_auth_number | operation     | server          | done | time                |
+----+--------------------+---------------+-----------------+------+---------------------+
|  1 |                  1 | specialUpdate | authorityserver |    0 | 2013-05-27 20:07:39 |
+----+--------------------+---------------+-----------------+------+---------------------+


misc/mod_zebraqueue.pl -b 1

|  2 |                  1 | specialUpdate | biblioserver    |    0 | 2013-05-27 20:08:47 |
Comment 14 Chris Cormack 2013-05-27 08:12:41 UTC
Created attachment 18409 [details] [review]
Bug 9286 - Add script to add a bib to the zebra queue from the command line

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: No test plan, but works.
Tested adding auth, biblios or both, then rebuilding -z
No errors.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Test Plan

1/ run misc/mod_zebraqueue.pl -a 1
2/ In your koha db
SELECT * FROM zebraqueue WHERE done = 0;
Check that a row for authority record id 1 has been inserted
3/ run misc/mod_zebraqueue.pl -b 1
4/ In your koha db
SELECT * FROM zebraqueue WHERE done = 0;
Check that a row for biblio record id 1 has been inserted
5/ run misc/mod_zebraqueue.pl
Make sure the help is sensible
Comment 15 Galen Charlton 2013-05-28 15:02:33 UTC
Pushed to master.  Thanks, Kyle!