Changeset 27357

Show
Ignore:
Timestamp:
16.05.2013 15:29:12 (6 years ago)
Author:
kjdon
Message:

setting sortfield info to buildproc, and getting it back from buildproc for the build.cfg file.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/lucenebuilder.pm

    r27329 r27357  
    410410    #$self->{'buildproc'}->set_indexfieldmap ($self->{'indexfieldmap'}); 
    411411    $self->{'buildproc'}->set_levels ($local_levels); 
     412    $self->{'buildproc'}->set_sortfields ($self->{'collect_cfg'}->{'sortfields'});; 
     413 
    412414    $self->{'buildproc'}->set_db_level($db_level); 
    413415    $self->{'buildproc'}->reset(); 
     
    490492# /** remove_document_from_database **/ 
    491493 
    492  
     494sub build_cfg_extra { 
     495    my $self = shift (@_); 
     496    my ($build_cfg) = @_; 
     497 
     498    $self->mgppbuilder::build_cfg_extra($build_cfg); 
     499 
     500    # need to add in sort stuff 
     501    my @sortfields = (); 
     502    my @sortfieldmap = (); 
     503 
     504    foreach my $sf (@{$self->{'buildproc'}->{'sortfields'}}) { 
     505    if ($sf eq "rank") { 
     506        push(@sortfields, $sf); 
     507    } elsif ($self->{'buildproc'}->{'actualsortfields'}->{$sf}) { 
     508        my $shortname = $self->{'buildproc'}->{'sortfieldnamemap'}->{$sf}; 
     509        push(@sortfields, $shortname); 
     510        push (@sortfieldmap, "$sf\-\>$shortname"); 
     511    } 
     512     
     513    } 
     514    $build_cfg->{'indexsortfields'} = \@sortfields; 
     515    $build_cfg->{'indexsortfieldmap'} = \@sortfieldmap; 
     516 
    4935171; 
    494518