Changeset 17575

Show
Ignore:
Timestamp:
23.10.2008 10:01:25 (11 years ago)
Author:
kjdon
Message:

implemented init_for_incremental_build to read in indexfields and indexfieldmap so that when doing an incremental build we don't lose this info

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/lucenebuilder.pm

    r17566 r17575  
    8282# /** new() **/ 
    8383 
     84sub init_for_incremental_build { 
     85    my $self = shift (@_); 
     86 
     87    # we want to read in indexfieldmap and indexfields from existing build.cfg 
     88    # so that we know what has already been indexed 
     89    my $buildcfg = $self->read_build_cfg(); 
     90    return unless defined $buildcfg; 
     91 
     92    my $field; 
     93    if (defined $buildcfg->{'indexfields'}) { 
     94    foreach $field (@{$buildcfg->{'indexfields'}}) { 
     95        $self->{'buildproc'}->{'indexfields'}->{$field} = 1; 
     96    } 
     97    } 
     98 
     99    if (defined $buildcfg->{'indexfieldmap'}) { 
     100    foreach $field (@{$buildcfg->{'indexfieldmap'}}) { 
     101        my ($f, $v) = $field =~ /^(.*)\-\>(.*)$/; 
     102        $self->{'buildproc'}->{'indexfieldmap'}->{$f} = $v; 
     103    } 
     104    }        
     105     
     106} 
     107 
    84108# lucene has none of these options 
    85109sub generate_index_options { 
     
    109133    my ($textindex) = @_; 
    110134    my $outhandle = $self->{'outhandle'}; 
    111     print STDERR "Saving the document text\n"; 
     135 
    112136    # the text directory 
    113137    my $text_dir = &util::filename_cat($self->{'build_dir'}, "text");