You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by sh...@apache.org on 2009/10/29 15:50:29 UTC
svn commit: r830977 -
/lucene/solr/branches/branch-1.4/src/java/org/apache/solr/core/CoreContainer.java
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);