/[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 146 by dpavlin, Wed May 10 21:33:32 2006 UTC revision 147 by dpavlin, Wed May 10 21:41:35 2006 UTC
# Line 19  my $c = { Line 19  my $c = {
19          sql => qq{          sql => qq{
20                  select * from history_collection_view_cache                  select * from history_collection_view_cache
21          },          },
22            pk_col => '_id',
23          db_encoding => 'iso-8859-2',          db_encoding => 'iso-8859-2',
24          debug => 0,          debug => 0,
25  };  };
# Line 45  my $total = $sth->rows; Line 46  my $total = $sth->rows;
46  my $i = 1;  my $i = 1;
47    
48  my $t = time();  my $t = time();
49    my $pk_col = $c->{pk_col} || 'id';
50    
51  while (my $row = $sth->fetchrow_hashref() ) {  while (my $row = $sth->fetchrow_hashref() ) {
52    
# Line 53  while (my $row = $sth->fetchrow_hashref( Line 55  while (my $row = $sth->fetchrow_hashref(
55          # create document          # create document
56          my $doc = new Search::Estraier::Document;          my $doc = new Search::Estraier::Document;
57    
58          $doc->add_attr('@uri', $row->{_id});          if (my $id = $row->{$pk_col}) {
59                    $doc->add_attr('@uri', $id);
60            } else {
61                    die "can't find pk_col column '$pk_col' in results\n";
62            }
63    
64          printf "%4d ",$i;          printf "%4d ",$i;
65    

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

  ViewVC Help
Powered by ViewVC 1.1.26