Changeset 24459

Show
Ignore:
Timestamp:
24.08.2011 15:50:52 (8 years ago)
Author:
davidb
Message:

Code changes to support indexers that are provided through the extension mechanism

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/buildcol.pl

    r24343 r24459  
    548548    } else {     
    549549 
    550     $builderdir = "$ENV{'GSDLHOME'}/perllib"; 
    551     if ($buildtype eq "lucene") { 
    552         $buildertype = "lucenebuilder"; 
    553     } 
    554     elsif ($buildtype eq "mgpp") { 
     550    $builderdir = undef; 
     551    if ($buildtype ne "") { 
     552        # caters for extension-based build types, such as 'solr' 
     553        $buildertype = $buildtype."builder"; 
     554    } 
     555    else { 
     556        # Default to mgpp 
    555557        $buildertype = "mgppbuilder"; 
    556     } 
    557     else { 
    558         $buildertype = "mgbuilder"; 
    559558    } 
    560559    } 
     
    618617    my $this_builderdir  = $builderdir_list[$i]; 
    619618 
    620     require "$this_builderdir/$this_buildertype.pm"; 
     619    if ((defined $this_builderdir) && ($this_builderdir ne "")) { 
     620        require "$this_builderdir/$this_buildertype.pm"; 
     621    } 
     622    else { 
     623        require "$this_buildertype.pm"; 
     624    } 
    621625 
    622626    eval("\$this_builder = new $this_buildertype(\$collection, " . 
     
    659663    #      (my $new =$_)->method(); $new  
    660664    #    but is a bit more cumbersome to write 
    661  
     665     
    662666    map { local $_=$_; $_->compress_text($textindex); } @builders; 
    663667    map { local $_=$_; $_->build_indexes($indexname); } @builders;