/[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 434 by dpavlin, Mon Apr 17 16:50:53 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 ($doc,$n,$v) = @_;
160                  eval { $doc->set_value($n, $self->convert($v) ) };                  eval { $doc->set_value($n, $self->convert($v) ) };
161                  $log->warn("can't insert: $n = $v") if ($@);                  $log->warn("can't insert: $n = $v") if ($@);
162          }          }
163    
164          add_value('uri', $uri);          add_value($doc, 'uri', $uri);
165    
166          $log->debug("ds = ", sub { Dumper($args->{'ds'}) } );          $log->debug("ds = ", sub { Dumper($args->{'ds'}) } );
167    
# Line 183  sub add { Line 183  sub add {
183                  $vals = $self->convert( $vals ) or                  $vals = $self->convert( $vals ) or
184                          $log->logdie("can't convert '$vals' to UTF-8");                          $log->logdie("can't convert '$vals' to UTF-8");
185    
186                  add_value( $tag, $vals );                  add_value($doc, $tag, $vals );
187          }          }
188    
189          if (my $text = $args->{'text'}) {          if (my $text = $args->{'text'}) {
190                  add_value( 'bodytext', $text );                  add_value($doc, 'bodytext', $text );
191          }          }
192    
193          #$log->debug("adding ", sub { $doc->dump_draft } );          #$log->debug("adding ", sub { $doc->dump_draft } );
# Line 196  sub add { Line 196  sub add {
196          return 1;          return 1;
197  }  }
198    
199    =head2 finish
200    
201    Close index
202    
203     $index->finish;
204    
205    =cut
206    
207    sub finish {
208            my $self = shift;
209    
210            $self->_get_logger()->info("finish index writing to disk");
211            $self->{invindex}->finish;
212    }
213    
214  =head2 convert  =head2 convert
215    

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

  ViewVC Help
Powered by ViewVC 1.1.26