lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r883202 - in /lucene/solr/trunk: CHANGES.txt example/solr/conf/solrconfig.xml src/java/org/apache/solr/core/CoreDescriptor.java src/java/org/apache/solr/core/SolrConfig.java
Date Mon, 23 Nov 2009 00:36:43 GMT
Author: yonik
Date: Mon Nov 23 00:36:42 2009
New Revision: 883202

URL: http://svn.apache.org/viewvc?rev=883202&view=rev
Log:
SOLR-1577: fix data dir default to stay under solr home

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/example/solr/conf/solrconfig.xml
    lucene/solr/trunk/src/java/org/apache/solr/core/CoreDescriptor.java
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=883202&r1=883201&r2=883202&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Mon Nov 23 00:36:42 2009
@@ -64,6 +64,12 @@
 * SOLR-1563: Binary fields, including trie-based numeric fields, caused null
   pointer exceptions in the luke request handler. (yonik)
 
+* SOLR-1577: The example solrconfig.xml defaulted to a solr data dir
+  relative to the current working directory, even if a different solr home
+  was being used.  The new behavior changes the default to a zero length
+  string, which is treated the same as if no dataDir had been specified,
+  hence the "data" directory under the solr home will be used.  (yonik)
+
 
 Other Changes
 ----------------------

Modified: lucene/solr/trunk/example/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/example/solr/conf/solrconfig.xml?rev=883202&r1=883201&r2=883202&view=diff
==============================================================================
--- lucene/solr/trunk/example/solr/conf/solrconfig.xml (original)
+++ lucene/solr/trunk/example/solr/conf/solrconfig.xml Mon Nov 23 00:36:42 2009
@@ -68,7 +68,7 @@
   <!-- Used to specify an alternate directory to hold all index data
        other than the default ./data under the Solr home.
        If replication is in use, this should match the replication configuration. -->
-  <dataDir>${solr.data.dir:./solr/data}</dataDir>
+  <dataDir>${solr.data.dir:}</dataDir>
 
 
   <!-- WARNING: this <indexDefaults> section only provides defaults for index writers

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/CoreDescriptor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/CoreDescriptor.java?rev=883202&r1=883201&r2=883202&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/CoreDescriptor.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/CoreDescriptor.java Mon Nov 23 00:36:42
2009
@@ -109,6 +109,8 @@
 
   public void setDataDir(String s) {
     dataDir = s;
+    // normalize zero length to null.
+    if (dataDir != null && dataDir.length()==0) dataDir=null;
   }
 
   /**@return the core instance directory. */

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java?rev=883202&r1=883201&r2=883202&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java Mon Nov 23 00:36:42 2009
@@ -160,6 +160,7 @@
     unlockOnStartup = getBool("mainIndex/unlockOnStartup", false);
     useColdSearcher = getBool("query/useColdSearcher",false);
     dataDir = get("dataDir", null);
+    if (dataDir != null && dataDir.length()==0) dataDir=null;
 
     userCacheConfigs = CacheConfig.getMultipleConfigs(this, "query/cache");
 



Mime
View raw message