Bug 6566 - Checking if DB records are properly indexed
Summary: Checking if DB records are properly indexed
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: 3.8
Hardware: All All
: P3 enhancement (vote)
Assignee: Christophe Croullebois
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 09:13 UTC by Christophe Croullebois
Modified: 2013-05-23 06:23 UTC (History)
5 users (show)

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


Attachments
new proposed patch (2.76 KB, patch)
2011-07-08 10:09 UTC, Christophe Croullebois
Details | Diff | Splinter Review
the last patch I hope (4.56 KB, patch)
2012-06-21 16:42 UTC, Christophe Croullebois
Details | Diff | Splinter Review
last patch (4.56 KB, patch)
2012-06-27 08:03 UTC, Christophe Croullebois
Details | Diff | Splinter Review
Bug 6566 Checking if DB's records are properly indexed (4.60 KB, patch)
2012-06-27 13:53 UTC, Robin Sheat
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Croullebois 2011-07-08 09:13:40 UTC
Small script that checks that each biblio in the DB is properly indexed.

parameters:
\th this help screen
\tc confirm (without this parameter, you get the help screen
\tz insert a signal in zebraqueue to force indexing of non indexed biblios
\ts silent throw no warnings except for non indexed records. Otherwise throw a warn every 1000 biblios to show progress

Syntax:
\t./batchCheckNonIndexedBiblios.pl -h (or without arguments => shows this screen)
\t./batchCheckNonIndexedBiblios.pl -c (c like confirm => check all records (may be long)
\t-t => test only, change nothing in DB
Comment 1 Christophe Croullebois 2011-07-08 10:09:21 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2011-08-04 08:03:04 UTC
Just a simple, very tiny remark: If I read your patch, I see that you offer a silent parameter, but your program doesn't do anything with it. That's really silent, isn't it? ;)
Comment 3 Jonathan Druart 2011-08-05 09:20:48 UTC
Same for -t parameter. It not exists in GetOptions, just in usage.

For -s option, i think we can change 

    print "biblionumber $biblionumber not indexed\n" unless $nbhits;

with

    print "biblionumber $biblionumber not indexed\n" unless $nbhits or not $silent;

or 

    print "biblionumber $biblionumber not indexed\n" if not $nbhits and $silent

(more readability)
Comment 4 Robin Sheat 2011-09-02 03:33:04 UTC
I'd like a more verbose description of what it's doing, it's not particularly clear what's happening without reading the source.

Also, it should have proper copyright headers.

Failing QA for this and the other points mentioned here.
Comment 5 Christophe Croullebois 2012-06-21 16:40:17 UTC
Hi,
thx for your comments.
1) copyright added Robin Sheat
2) tryed to rewrite the help text
3) right M. de Rooy ;oD very silent, maybe too, now whe have it
4) due to Jonathan Druart's comment I have added a stealth option to optimise what you print
5) no need to "-t" Jonathan ;o) just do not use -z, some dross... fixed
6) -s was only for avoiding the warn every 1000 biblios so I have added stealth, you have the choice, so your suggest Jonathan was bad placed and I think we must avoid "or" in this case, also you inverted "..not $silent" ;o)
so I hope it's ok.
thx for testing
Comment 6 Christophe Croullebois 2012-06-21 16:42:48 UTC Comment hidden (obsolete)
Comment 7 Christophe Croullebois 2012-06-27 08:03:25 UTC Comment hidden (obsolete)
Comment 8 Robin Sheat 2012-06-27 08:59:31 UTC
Just saying that the changes applied look good to me, I'm adding it to my list to sign off on, unless someone beats me to it (it's a pretty long list.)
Comment 9 Robin Sheat 2012-06-27 13:53:08 UTC
Created attachment 10541 [details] [review]
Bug 6566 Checking if DB's records are properly indexed

Small script that checks if each bibliorecord in the DB is properly indexed
use -h to learn more
(MT #6389)

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Comment 10 Robin Sheat 2012-06-27 13:55:22 UTC
My only real comment on it is that it probably doesn't need to be in migration_tools, as it's not really a migration tool. But there's all sorts of stuff in there as it is.
Comment 11 Paul Poulain 2012-07-06 15:58:07 UTC
QA comment:
 * new script, that can't break anything
 * passes perlcritic
 * Well documented, and various options to fit various needs (from highly silent if you run as cron to verbose if you run manually)

Very usefull when run as cron every week, to check everything it OK.

Here is how we use this script at BibLibre: every sunday, we run the script twice : 1st time, sending a flag for zebra to reindex unfound biblios, 2nd time without the flag, to find records that are really not indexable.

Passed QA
Comment 12 Paul Poulain 2012-07-06 15:59:08 UTC
Enhancement, but I think it's worth being ported to 3.8, and it's safe.