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

(-)a/misc/migration_tools/rebuild_zebra.pl (-3 / +28 lines)
Lines 34-39 my $want_help; Link Here
34
my $as_xml;
34
my $as_xml;
35
my $process_zebraqueue;
35
my $process_zebraqueue;
36
my $do_not_clear_zebraqueue;
36
my $do_not_clear_zebraqueue;
37
my $item_limit;
38
my $min;
39
my $where;
40
my $offset;
37
my $verbose_logging = 0;
41
my $verbose_logging = 0;
38
my $zebraidx_log_opt = " -v none,fatal,warn ";
42
my $zebraidx_log_opt = " -v none,fatal,warn ";
39
my $result = GetOptions(
43
my $result = GetOptions(
Lines 51-56 my $result = GetOptions( Link Here
51
	'x'				=> \$as_xml,
55
	'x'				=> \$as_xml,
52
    'y'             => \$do_not_clear_zebraqueue,
56
    'y'             => \$do_not_clear_zebraqueue,
53
    'z'             => \$process_zebraqueue,
57
    'z'             => \$process_zebraqueue,
58
    'l:i'           => \$item_limit,
59
    'where:s'       => \$where,
60
    'min:i'         => \$min,
61
    'offset:i'      => \$offset,
54
    'v+'            => \$verbose_logging,
62
    'v+'            => \$verbose_logging,
55
);
63
);
56
64
Lines 294-306 sub select_all_records { Link Here
294
}
302
}
295
303
296
sub select_all_authorities {
304
sub select_all_authorities {
297
    my $sth = $dbh->prepare("SELECT authid FROM auth_header");
305
    my $strsth=qq{SELECT authid FROM auth_header};
306
    $strsth.=qq{ WHERE $where } if ($where);
307
    $strsth.=qq{ LIMIT $min } if ($min && !$offset);
308
    $strsth.=qq{ LIMIT $offset,$min } if ($min && $offset);
309
    my $sth = $dbh->prepare($strsth);
298
    $sth->execute();
310
    $sth->execute();
299
    return $sth;
311
    return $sth;
300
}
312
}
301
313
302
sub select_all_biblios {
314
sub select_all_biblios {
303
    my $sth = $dbh->prepare("SELECT biblionumber FROM biblioitems ORDER BY biblionumber");
315
    my $strsth = qq{ SELECT biblionumber FROM biblioitems };
316
    $strsth.=qq{ WHERE $where } if ($where);
317
    $strsth.=qq{ LIMIT $min } if ($min && !$offset);
318
    $strsth.=qq{ LIMIT $offset,$min } if ($offset);
319
    my $sth = $dbh->prepare($strsth);
304
    $sth->execute();
320
    $sth->execute();
305
    return $sth;
321
    return $sth;
306
}
322
}
Lines 635-644 Parameters: Link Here
635
                            the same records - specify -y to override this.  
651
                            the same records - specify -y to override this.  
636
                            Cannot be used with -z.
652
                            Cannot be used with -z.
637
653
654
    -l                      set a maximum number of exported items per biblio.
655
                            Doesn't work with -nosanitize.
638
    -v                      increase the amount of logging.  Normally only 
656
    -v                      increase the amount of logging.  Normally only 
639
                            warnings and errors from the indexing are shown.
657
                            warnings and errors from the indexing are shown.
640
                            Use log level 2 (-v -v) to include all Zebra logs.
658
                            Use log level 2 (-v -v) to include all Zebra logs.
641
659
660
    -min   1234             minimum biblionumber
661
    -offset 1243            count biblios to process
662
                                example: -min 1000 -offset=500 will result in a LIMIT 500,1000 (exporting 1000 records, starting by the 500th one)
663
                                note that the numbers are NOT related to biblionumber, that's the intended behaviour.
664
665
    -where                  let you specify a WHERE query, like itemtype='BOOK'
666
                            or something like that
667
642
    -munge-config           Deprecated option to try
668
    -munge-config           Deprecated option to try
643
                            to fix Zebra config files.
669
                            to fix Zebra config files.
644
    --help or -h            show this message.
670
    --help or -h            show this message.
645
- 

Return to bug 7246