change dataDir to return dir containing index

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@503488 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-02-04 21:33:20 +00:00
parent 7dec1958a4
commit 24d527bb51
1 changed files with 4 additions and 4 deletions

View File

@ -102,7 +102,7 @@ public final class SolrCore {
} }
public IndexSchema getSchema() { return schema; } public IndexSchema getSchema() { return schema; }
public String getDataDir() { return index_path; } public String getDataDir() { return dataDir; }
public String getIndexDir() { return index_path; } public String getIndexDir() { return index_path; }
private final RequestHandlers reqHandlers = new RequestHandlers(SolrConfig.config); private final RequestHandlers reqHandlers = new RequestHandlers(SolrConfig.config);
@ -114,7 +114,7 @@ public final class SolrCore {
// gets a non-caching searcher // gets a non-caching searcher
public SolrIndexSearcher newSearcher(String name) throws IOException { public SolrIndexSearcher newSearcher(String name) throws IOException {
return new SolrIndexSearcher(schema, name,getDataDir(),false); return new SolrIndexSearcher(schema, name,getIndexDir(),false);
} }
@ -129,7 +129,7 @@ public final class SolrCore {
// if it didn't exist already... // if it didn't exist already...
Directory dir = FSDirectory.getDirectory(dirFile, !indexExists); Directory dir = FSDirectory.getDirectory(dirFile, !indexExists);
if (IndexReader.isLocked(dir)) { if (IndexReader.isLocked(dir)) {
log.warning("WARNING: Solr index directory '" + getDataDir() + "' is locked. Unlocking..."); log.warning("WARNING: Solr index directory '" + getIndexDir() + "' is locked. Unlocking...");
IndexReader.unlock(dir); IndexReader.unlock(dir);
} }
} }
@ -140,7 +140,7 @@ public final class SolrCore {
log.warning("Solr index directory '" + dirFile + "' doesn't exist." log.warning("Solr index directory '" + dirFile + "' doesn't exist."
+ " Creating new index..."); + " Creating new index...");
SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex",getDataDir(), true, schema, mainIndexConfig); SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex",getIndexDir(), true, schema, mainIndexConfig);
writer.close(); writer.close();
} }