/[Search-Estraier]/trunk/scripts/dbi-indexer.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/scripts/dbi-indexer.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 145 by dpavlin, Wed May 10 21:09:05 2006 UTC revision 146 by dpavlin, Wed May 10 21:33:32 2006 UTC
# Line 5  use Search::Estraier 0.06; Line 5  use Search::Estraier 0.06;
5  use DBI;  use DBI;
6  use Data::Dumper;  use Data::Dumper;
7  use Encode qw/from_to/;  use Encode qw/from_to/;
8    use Time::HiRes qw/time/;
9    
10  =head1 NAME  =head1 NAME
11    
# Line 43  warn "# columns: ",join(",",@{ $sth->{NA Line 44  warn "# columns: ",join(",",@{ $sth->{NA
44  my $total = $sth->rows;  my $total = $sth->rows;
45  my $i = 1;  my $i = 1;
46    
47    my $t = time();
48    
49  while (my $row = $sth->fetchrow_hashref() ) {  while (my $row = $sth->fetchrow_hashref() ) {
50    
51          warn "# row: ",Dumper($row) if ($c->{debug});          warn "# row: ",Dumper($row) if ($c->{debug});
# Line 73  while (my $row = $sth->fetchrow_hashref( Line 76  while (my $row = $sth->fetchrow_hashref(
76    
77          }          }
78    
         print " ", int(( $i++ / $total) * 100), "%\n";  
   
79          warn "# doc draft: ",$doc->dump_draft, "\n" if ($c->{debug});          warn "# doc draft: ",$doc->dump_draft, "\n" if ($c->{debug});
80    
81          die "error: ", $node->status,"\n" unless (eval { $node->put_doc($doc) });          die "error: ", $node->status,"\n" unless (eval { $node->put_doc($doc) });
82    
83            printf (" %d%% %.1f/s\n", int(( $i++ / $total) * 100), ( $i / (time() - $t) ) );
84    
85  }  }

Legend:
Removed from v.145  
changed lines
  Added in v.146

  ViewVC Help
Powered by ViewVC 1.1.26