lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r919444 - /lucene/solr/trunk/src/java/org/apache/solr/core/CoreContainer.java
Date Fri, 05 Mar 2010 15:18:02 GMT
Author: markrmiller
Date: Fri Mar  5 15:18:00 2010
New Revision: 919444

URL: http://svn.apache.org/viewvc?rev=919444&view=rev
Log:
SOLR-1722: small bug - defaultCoreName is looked for at /solr, but should be /solr/cores -
also, defaultCoreName should really not default to DEFAULT_DEFAULT_CORENAME

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/core/CoreContainer.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/CoreContainer.java?rev=919444&r1=919443&r2=919444&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/CoreContainer.java Fri Mar  5 15:18:00
2010
@@ -70,7 +70,7 @@
   protected String solrHome;
   protected String solrConfigFilenameOverride;
 
-  private String defaultCoreName = DEFAULT_DEFAULT_CORE_NAME;
+  private String defaultCoreName = "";
 
   public CoreContainer() {
     solrHome = SolrResourceLoader.locateSolrHome();
@@ -212,7 +212,7 @@
     solrHome = loader.getInstanceDir();
     try {
       Config cfg = new Config(loader, null, cfgis, null);
-      String dcoreName = cfg.get("solr/@defaultCoreName", null);
+      String dcoreName = cfg.get("solr/cores/@defaultCoreName", null);
       if(dcoreName != null) {
         defaultCoreName = dcoreName;
       }
@@ -573,6 +573,10 @@
     return coreAdminHandler;
   }
   
+  public String getDefaultCoreName() {
+    return defaultCoreName;
+  }
+  
   // all of the following properties aren't synchronized
   // but this should be OK since they normally won't be changed rapidly
   public boolean isPersistent() {
@@ -773,7 +777,7 @@
   }
   private static final String DEF_SOLR_XML ="<?xml version=\"1.0\" encoding=\"UTF-8\"
?>\n" +
           "<solr persistent=\"false\">\n" +
-          "  <cores adminPath=\"/admin/cores\">\n" +
+          "  <cores adminPath=\"/admin/cores\" defaultCoreName=\"" + DEFAULT_DEFAULT_CORE_NAME
+ "\">\n" +
           "    <core name=\""+ DEFAULT_DEFAULT_CORE_NAME + "\" instanceDir=\".\" />\n"
+
           "  </cores>\n" +
           "</solr>";



Mime
View raw message