/[pgestraier]/trunk/data/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/data/indexer.pl

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

revision 85 by dpavlin, Wed Jan 17 22:30:14 2007 UTC revision 86 by dpavlin, Wed Apr 18 15:55:47 2007 UTC
# Line 18  my $node = Search::Estraier::Node->new( Line 18  my $node = Search::Estraier::Node->new(
18  );  );
19    
20  my $nr = 1;  my $nr = 1;
21    my $max = 0;    # no limit
22    
23  parse_trivia($t, sub {  parse_trivia($t, sub {
24    
# Line 38  parse_trivia($t, sub { Line 39  parse_trivia($t, sub {
39    
40                  $doc->add_attr('year', $a->{year}) if ($a->{year});                  $doc->add_attr('year', $a->{year}) if ($a->{year});
41                  foreach my $q ( $a->{qv} ) {                  foreach my $q ( $a->{qv} ) {
42                            $q = join(' ', @$q) if (ref($q) eq 'ARRAY');
43                            next unless ($q);
44                          $doc->add_attr('quote', $q);                          $doc->add_attr('quote', $q);
45                          $doc->add_hidden_text($q);                          $doc->add_hidden_text($q);
46                  }                  }
# Line 45  parse_trivia($t, sub { Line 48  parse_trivia($t, sub {
48                  # add the body text to the document object                  # add the body text to the document object
49                  $doc->add_text($a->{trivia});                  $doc->add_text($a->{trivia});
50    
   
51                  # register the document object to the database                  # register the document object to the database
52                  $node->put_doc($doc);                  $node->put_doc($doc);
53    
54                    $nr++;
55                    last if ($max && $nr > $max);
56    
57  });  });

Legend:
Removed from v.85  
changed lines
  Added in v.86

  ViewVC Help
Powered by ViewVC 1.1.26