lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r830977 - /lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java
Date Thu, 29 Oct 2009 14:50:29 GMT
Author: shalin
Date: Thu Oct 29 14:50:29 2009
New Revision: 830977

URL: http://svn.apache.org/viewvc?rev=830977&view=rev
Log:
SOLR-1527 -- shareSchema does not work with absolute paths


Modified:
    lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java

Modified: lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java?rev=830977&r1=830976&r2=830977&view=diff
==============================================================================
--- lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java Thu Oct
29 14:50:29 2009
@@ -406,9 +406,12 @@
     IndexSchema schema = null;
     if(indexSchemaCache != null){
       //schema sharing is enabled. so check if it already is loaded
-      File schemFile = new File(solrLoader.getInstanceDir() + "conf" + File.separator + dcore.getSchemaName());
-      if(schemFile. exists()){
-        String key = schemFile.getAbsolutePath()+":"+new SimpleDateFormat("yyyyMMddhhmmss").format(new
Date(schemFile.lastModified()));
+      File schemaFile = new File(dcore.getSchemaName());
+      if (!schemaFile.isAbsolute()) {
+        schemaFile = new File(solrLoader.getInstanceDir() + "conf" + File.separator + dcore.getSchemaName());
+      }
+      if(schemaFile. exists()){
+        String key = schemaFile.getAbsolutePath()+":"+new SimpleDateFormat("yyyyMMddhhmmss").format(new
Date(schemaFile.lastModified()));
         schema = indexSchemaCache.get(key);
         if(schema == null){
           log.info("creating new schema object for core: " + dcore.name);



Mime
View raw message