/[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 431 by dpavlin, Mon Apr 17 15:10:04 2006 UTC revision 432 by dpavlin, Mon Apr 17 16:01:02 2006 UTC
# Line 154  sub add { Line 154  sub add {
154          $log->debug("creating $uri");          $log->debug("creating $uri");
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          eval { $doc->set_value('uri', $self->convert($uri) ) };  
158            sub add_value($$) {
159                    my ($n,$v) = @_;
160                    eval { $doc->set_value($n, $self->convert($v) ) };
161                    $log->warn("can't insert: $n = $v") if ($@);
162            }
163    
164            add_value('uri', $uri);
165    
166          $log->debug("ds = ", sub { Dumper($args->{'ds'}) } );          $log->debug("ds = ", sub { Dumper($args->{'ds'}) } );
167    
# Line 176  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                  eval { $doc->set_value( $tag, $vals ) };                  add_value( $tag, $vals );
187          }          }
188    
189          my $text = $args->{'text'};          if (my $text = $args->{'text'}) {
190          if ( $text ) {                  add_value( 'bodytext', $text );
                 $text = $self->convert( $text ) or  
                         $log->logdie("can't convert '$text' to UTF-8");  
                 eval { $doc->set_value( bodytext => $text ) };  
191          }          }
192    
193          #$log->debug("adding ", sub { $doc->dump_draft } );          #$log->debug("adding ", sub { $doc->dump_draft } );

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

  ViewVC Help
Powered by ViewVC 1.1.26