Changeset 29142


Ignore:
Timestamp:
07/16/14 21:09:14 (7 years ago)
Author:
ak19
Message:

Part of port from lucene3.3.0 to lucene4.7.2. Solr related. 1. Java and perl code changes for solr4.7.2; 2. Dr Bainbridge further fixed a bug in how the variable called running is set in solrserver.pm

Location:
gs3-extensions/solr/trunk/src
Files:
6 edited

Legend:

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

    r27815 r29142  
    318318   
    319319    # make sure output conf directory exists
    320     if (!FileUtils::directoryExists($out_dirname)) {
     320    if (!&FileUtils::directoryExists($out_dirname)) {
    321321    &FileUtils::makeDirectory($out_dirname);
    322322    }
     
    328328
    329329    my @in_file_list = ( "solrconfig.xml", "stopwords.txt", "stopwords_en.txt",
    330              "synonyms.txt", "protwords.txt" );
     330             "synonyms.txt", "protwords.txt", "currency.xml", "elevate.xml" );
    331331 
    332332    foreach my $file ( @in_file_list ) {
    333333    my $in_filename = &FileUtils::filenameConcatenate($in_dirname,$file.".in");
    334334    my $out_filename = &FileUtils::filenameConcatenate($out_dirname,$file);
    335     filter_in_out_file($in_filename,$out_filename,[]);
     335
     336    if(&FileUtils::fileExists($in_filename)) {
     337        filter_in_out_file($in_filename,$out_filename,[]);
     338    }
     339    }
     340
     341    my @in_dir_list = ( "lang" );
     342    foreach my $dir ( @in_dir_list ) {
     343   
     344    my $full_subdir_name = &FileUtils::filenameConcatenate($in_dirname,$dir);
     345
     346    if(&FileUtils::directoryExists($full_subdir_name)) {
     347        &FileUtils::copyFilesRecursiveNoSVN($full_subdir_name, $out_dirname);
     348    }
    336349    }
    337350}
     
    469482        &FileUtils::makeDirectory($full_index_dir);
    470483
     484        my $full_tlog_dir = &FileUtils::filenameConcatenate($full_index_dir, "tlog");
     485        &FileUtils::makeDirectory($full_tlog_dir);
     486
    471487        # Solr then wants an "index" folder within this general index area!
    472488#       my $full_index_index_dir = &FileUtils::filenameConcatenate($full_index_dir,"index");
  • gs3-extensions/solr/trunk/src/perllib/solrserver.pm

    r28182 r29142  
    158158    my $have_error = defined $output->{'error'};
    159159
    160     my $running = !$have_error;
     160    my $running = ($have_error) ? 0 : 1;
    161161
    162162    return $running;
     
    407407    my $full_server_jar = $self->{'full_server_jar'};
    408408   
    409     my $server_java_cmd = "java $server_props -jar \"$full_server_jar\"";
     409    # https://wiki.apache.org/solr/SolrLogging
     410    my $solr_slf4j    = &util::filename_cat($solr_home, "lib", "ext");
     411    my $solr_log4j    = &util::filename_cat($solr_home, "conf", "log4j.properties");
     412    my $server_java_cmd = "java -Dlog4j.configuration=file://$solr_log4j -classpath \"$solr_home/lib/java/*:$solr_slf4j/*\" $server_props -jar \"$full_server_jar\"";
    410413
    411414
     
    431434        }
    432435       
    433         if ($line =~ m/WARN::failed SocketConnector/) {
     436        if ($line =~ m/WARN.*failed SocketConnector/) {
    434437        if ($line =~ m/Address already in use/) {
    435438            $server_status = "already-running";
     
    441444        }
    442445       
    443         if ($line =~ m/INFO::Started SocketConnector/) {
     446        if ($line =~ m/INFO.*Started SocketConnector/) {
    444447        $server_status = "explicitly-started";
    445448        last;
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java

    r28967 r29142  
    3535import org.apache.solr.core.CoreContainer;
    3636import org.apache.solr.core.SolrCore;
    37 import org.greenstone.LuceneWrapper3.SharedSoleneQueryResult;
     37import org.greenstone.LuceneWrapper4.SharedSoleneQueryResult;
    3838import org.greenstone.gsdl3.util.FacetWrapper;
    3939import org.greenstone.gsdl3.util.GSFile;
     
    109109            File solr_xml = new File( solr_home,"solr.xml" );
    110110           
    111             all_solr_cores.load(solr_home_str,solr_xml);
     111            //all_solr_cores.load(solr_home_str,solr_xml);
     112            all_solr_cores.load();
    112113
    113114        } catch (Exception e) {
     
    184185                if(solrCoreName.startsWith(collection_core_name_prefix)) {
    185186               
    186                 logger.error("**** Removing collection-specific core: " + solrCoreName + " from CoreContainer");
     187                logger.info("**** Removing collection-specific core: " + solrCoreName + " from CoreContainer");
    187188               
    188189                // CoreContainer.remove(String name): removes and returns registered core w/o decrementing it's reference count
     
    190191                SolrCore solr_core = all_solr_cores.remove(solrCoreName);
    191192                while(!solr_core.isClosed()) {
    192                     logger.error("@@@@@@ " + solrCoreName + " was not closed. Closing....");
     193                    logger.warn("@@@@@@ " + solrCoreName + " was not closed. Closing....");
    193194                    solr_core.close(); // http://lucene.apache.org/solr/api/org/apache/solr/core/SolrCore.html
    194195                }
    195196                if(solr_core.isClosed()) {
    196                     logger.error("@@@@@@ " + solrCoreName + " is closed.");
     197                    logger.info("@@@@@@ " + solrCoreName + " is closed.");
    197198                }
    198199                solr_core = null;
     
    208209            Collection<String> coreNamesRemaining = all_solr_cores.getCoreNames();
    209210            if(coreNamesRemaining.isEmpty()) {
    210             logger.error("**** CoreContainer contains 0 solrCores. Shutting down...");
     211            logger.info("**** CoreContainer contains 0 solrCores. Shutting down...");
    211212           
    212213            all_solr_cores.shutdown(); // wouldn't do anything anyway for 0 cores I think
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java

    r28967 r29142  
    146146            File solr_xml = new File( solr_home,"solr.xml" );
    147147           
    148             solr_cores.load(solr_home_str,solr_xml);           
     148            //solr_cores.load(solr_home_str,solr_xml);         
     149            solr_cores.load();
    149150        } catch (Exception e) {
    150151            logger.error("Exception in SolrSearch.configure(): " + e.getMessage());
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryResult.java

    r25864 r29142  
    3030
    3131import org.apache.solr.client.solrj.response.FacetField;
    32 import org.greenstone.LuceneWrapper3.SharedSoleneQueryResult;
     32import org.greenstone.LuceneWrapper4.SharedSoleneQueryResult;
    3333
    3434/**
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java

    r28163 r29142  
    3939import org.apache.solr.common.SolrDocumentList;
    4040import org.apache.solr.common.params.ModifiableSolrParams;
    41 import org.greenstone.LuceneWrapper3.SharedSoleneQuery;
    42 import org.greenstone.LuceneWrapper3.SharedSoleneQueryResult;
     41import org.greenstone.LuceneWrapper4.SharedSoleneQuery;
     42import org.greenstone.LuceneWrapper4.SharedSoleneQueryResult;
    4343
    4444import com.google.gson.Gson;
Note: See TracChangeset for help on using the changeset viewer.