Changeset 25889 for gs3-extensions/solr

Show
Ignore:
Timestamp:
28.06.2012 21:25:18 (7 years ago)
Author:
ak19
Message:

Second set of commits for getting activate.pl to deal with solr cores when moving building to index. This time it uses the building- prefix and things still work. However, if the GS3 server is already running, an ant restart is required before searches return results and not sure about whether the incremental case is covered properly. The index reason is still being created for some reason when building.

Location:
gs3-extensions/solr/trunk/src/perllib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/perllib/solrbuilder.pm

    r25846 r25889  
    116116    my $core_prefix = (defined $site) ? "$site-$collect" : $collect; 
    117117    my $core        = $core_prefix; # unused in this call to solr_passes 
     118 
     119    $core = "building-".$core unless $self->{'incremental'}; # core points to building only for force_removeold 
    118120 
    119121        print STDERR "Executable:    $solr_passes_exe\n"; 
     
    397399    if ($force_removeold) { 
    398400        print $outhandle "\n-removeold set (new index will be created)\n"; 
     401 
     402        # create cores under temporary core names, corresponding to building directory 
     403        $core = "building-".$core;  
    399404 
    400405        my $full_index_dir = &util::filename_cat($build_dir,$index_dir); 
     
    516521    my $core        = "$core_prefix-$ds_idx"; 
    517522 
     523    $core = "building-".$core unless $self->{'incremental'}; # core points to building only for force_removeold 
     524 
    518525    print STDERR "Cmd: $solr_passes_exe $core index \"$build_dir\" \"$indexdir\"   $osextra\n"; 
    519526    if (!open($handle, "| $solr_passes_exe $core index \"$build_dir\" \"$indexdir\"   $osextra")) { 
  • gs3-extensions/solr/trunk/src/perllib/solrserver.pm

    r25888 r25889  
    276276{ 
    277277    my $self = shift @_; 
    278     my ($core) = @_; 
     278    my ($core, $delete) = @_; 
    279279 
    280280    my $cgi_get_args = "action=UNLOAD&core=$core"; # &deleteIndex=true from Solr3.3 
     281    if(defined $delete && $delete == 1) { 
     282    $cgi_get_args = $cgi_get_args."&deleteIndex=true"; 
     283    } 
    281284 
    282285    $self->_admin_service($cgi_get_args);