3 # $Id: reindex.pl,v 1.3 2007-03-07 11:35:38 mike Exp $
10 print STDERR "Usage: $0 target\n";
14 my $conn = new ZOOM::Connection($ARGV[0]);
15 $conn->option(preferredRecordSyntax => "xml");
16 $conn->option(elementSetName => "zebra::data");
17 my $rs = $conn->search_pqf('@attr 1=_ALLRECORDS @attr 2=103 ""');
20 print "$0: reindexing $n records\n";
21 foreach my $i (1..$n) {
23 print " $i/$n (", int($i*100/$n), "%)\n" if $i % 50 == 0;
24 my $rec = $rs->record($i-1);
25 my $xml = $rec->render();
28 print " $n/$n (100%)\n" if $n % 50 != 0;
33 # These might be better as ZOOM::Connection methods
37 my $p = $conn->package();
38 $p->option(action => "specialUpdate");
39 $p->option(record => $xml);
47 my $p = $conn->package();