Changeset 24643

Show
Ignore:
Timestamp:
25.09.2011 23:26:49 (8 years ago)
Author:
davidb
Message:

Adjustments to code as a result of testing

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

Legend:

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

    r24501 r24643  
    236236    $schema_insert_xml .= "    "; # indent 
    237237    $schema_insert_xml .= "<field name=\"$field\" "; 
    238     $schema_insert_xml .=   "type=\"string\" indexed=\"true\" "; 
     238    $schema_insert_xml .=   "type=\"text_en_splitting\" indexed=\"true\" "; 
    239239    $schema_insert_xml .=   "stored=\"false\" multiValued=\"true\" />\n";  
    240240    } 
     
    249249    my $in_dirname = &util::filename_cat($solr_home,"conf"); 
    250250    my $schema_in_filename = &util::filename_cat($in_dirname,"schema.xml.in"); 
    251  
    252251 
    253252    my $collect_home = $ENV{'GSDLCOLLECTDIR'}; 
     
    384383    my $core = "$core_prefix-$index_dir"; 
    385384 
     385    # force_removeold == opposite of being run in 'incremental' mode 
    386386    my $force_removeold = ($self->{'incremental'}) ? 0 : 1; 
     387 
    387388    if ($force_removeold) { 
    388389        print $outhandle "\n-removeold set (new index will be created)\n"; 
     
    391392        &util::rm_r($full_index_dir); 
    392393        &util::mk_dir($full_index_dir); 
    393     } 
    394  
    395     # if collect==core already in solr.xml (check with STATUS) 
    396     # => use RELOAD call to refresh fields now expressed in schema.xml 
    397     # 
    398     # else  
    399     # => use CREATE API to add to solr.xml 
    400          
    401     my $check_core_exists = $solr_server->admin_ping_core($core); 
    402         
    403     if ($check_core_exists) {        
    404         print $outhandle "Reloading Solr core: $core\n"; 
    405         $solr_server->admin_reload_core($core); 
    406     } 
    407     else { 
     394 
     395        # Solr then wants an "index" folder within this general index area! 
     396#       my $full_index_index_dir = &util::filename_cat($full_index_dir,"index"); 
     397#       &util::mk_dir($full_index_index_dir); 
     398 
     399 
     400        # now go on and create new index 
    408401        print $outhandle "Creating Solr core: $core\n"; 
    409402        $solr_server->admin_create_core($core); 
     403 
     404    } 
     405    else { 
     406        # if collect==core already in solr.xml (check with STATUS) 
     407        # => use RELOAD call to refresh fields now expressed in schema.xml 
     408        # 
     409        # else  
     410        # => use CREATE API to add to solr.xml 
     411         
     412        my $check_core_exists = $solr_server->admin_ping_core($core); 
     413        
     414        if ($check_core_exists) {        
     415        print $outhandle "Reloading Solr core: $core\n"; 
     416        $solr_server->admin_reload_core($core); 
     417        } 
     418        else { 
     419        print $outhandle "Creating Solr core: $core\n"; 
     420        $solr_server->admin_create_core($core); 
     421        } 
    410422    } 
    411423    } 
  • gs3-extensions/solr/trunk/src/perllib/solrserver.pm

    r24501 r24643  
    115115    } 
    116116 
    117     my $output = { 'preamble' => $preamble_output, 
     117    my $output = { 'url'      => $full_url, 
     118           'preamble' => $preamble_output, 
    118119           'output'   => $xml_output, 
    119120           'error'    => $error_output };