/[webpac2]/trunk/lib/WebPAC/Output/KinoSearch.pm
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/lib/WebPAC/Output/KinoSearch.pm

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

revision 432 by dpavlin, Mon Apr 17 16:01:02 2006 UTC revision 437 by dpavlin, Sun Apr 30 19:06:09 2006 UTC
# Line 155  sub add { Line 155  sub add {
155    
156          my $doc = $self->{invindex}->new_doc( $uri ) || $log->logdie("can't create new_doc( $uri )");          my $doc = $self->{invindex}->new_doc( $uri ) || $log->logdie("can't create new_doc( $uri )");
157    
158          sub add_value($$) {          sub add_value($$$$$) {
159                  my ($n,$v) = @_;                  my ($self,$log,$doc,$n,$v) = @_;
160                    return unless ($v);
161                  eval { $doc->set_value($n, $self->convert($v) ) };                  eval { $doc->set_value($n, $self->convert($v) ) };
162                  $log->warn("can't insert: $n = $v") if ($@);                  $log->warn("can't insert: $n = $v") if ($@);
163          }          }
164    
165          add_value('uri', $uri);          add_value($self,$log,$doc, 'uri', $uri);
166    
167          $log->debug("ds = ", sub { Dumper($args->{'ds'}) } );          $log->debug("ds = ", sub { Dumper($args->{'ds'}) } );
168    
# Line 183  sub add { Line 184  sub add {
184                  $vals = $self->convert( $vals ) or                  $vals = $self->convert( $vals ) or
185                          $log->logdie("can't convert '$vals' to UTF-8");                          $log->logdie("can't convert '$vals' to UTF-8");
186    
187                  add_value( $tag, $vals );                  add_value($self, $log, $doc, $tag, $vals );
188          }          }
189    
190          if (my $text = $args->{'text'}) {          if (my $text = $args->{'text'}) {
191                  add_value( 'bodytext', $text );                  add_value($self, $log, $doc, 'bodytext', $text );
192          }          }
193    
194          #$log->debug("adding ", sub { $doc->dump_draft } );          #$log->debug("adding ", sub { $doc->dump_draft } );
# Line 196  sub add { Line 197  sub add {
197          return 1;          return 1;
198  }  }
199    
200    =head2 finish
201    
202    Close index
203    
204     $index->finish;
205    
206    =cut
207    
208    sub finish {
209            my $self = shift;
210    
211            $self->_get_logger()->info("finish index writing to disk");
212            $self->{invindex}->finish;
213    }
214    
215  =head2 convert  =head2 convert
216    

Legend:
Removed from v.432  
changed lines
  Added in v.437

  ViewVC Help
Powered by ViewVC 1.1.26