SOLR-1527 -- shareSchema does not work with absolute paths

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@830938 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-10-29 13:36:05 +00:00
parent 82955637e6
commit 31ce47e759
1 changed files with 6 additions and 3 deletions

View File

@ -406,9 +406,12 @@ public class CoreContainer
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);