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

(-)a/misc/migration_tools/rebuild_zebra.pl (-4 / +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 $length;
39
my $where;
40
my $offset;
37
my $verbose_logging;
41
my $verbose_logging;
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
    'length:i'        => \$length,
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 $length } if ($length && !$offset);
308
    $strsth.=qq{ LIMIT $offset,$length } if ($length && $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 $length } if ($length && !$offset);
318
    $strsth.=qq{ LIMIT $offset,$length } 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
658
641
    -munge-config           Deprecated option to try
659
    --length   1234         how many biblio you want to export
660
    --offset 1243           offset you want to start to
661
                                example: --offset 500 --length=500 will result in a LIMIT 500,1000 (exporting 1000 records, starting by the 500th one)
662
                                note that the numbers are NOT related to biblionumber, that's the intended behaviour.
663
    --where                 let you specify a WHERE query, like itemtype='BOOK' 
664
                            or something like that
665
666
    --munge-config          Deprecated option to try
642
                            to fix Zebra config files.
667
                            to fix Zebra config files.
643
    --help or -h            show this message.
668
    --help or -h            show this message.
644
_USAGE_
669
_USAGE_
645
- 

Return to bug 7246