mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
SEARCH-300: Moving the content store out of solrhome.
This commit is contained in:
@@ -60,7 +60,7 @@ import org.slf4j.LoggerFactory;
|
||||
public class SolrContentStore implements ContentStore
|
||||
{
|
||||
protected final static Logger log = LoggerFactory.getLogger(SolrContentStore.class);
|
||||
private static final String CONTENT_STORE = "ContentStore";
|
||||
private static final String CONTENT_STORE = "contentstore";
|
||||
/**
|
||||
* Constructor.
|
||||
* @param solrHome
|
||||
@@ -72,7 +72,13 @@ public class SolrContentStore implements ContentStore
|
||||
throw new RuntimeException("Path to SOLR_HOME is required");
|
||||
}
|
||||
|
||||
String path = SolrResourceLoader.normalizeDir(solrHome) + CONTENT_STORE;
|
||||
File solrHomeFile = new File(SolrResourceLoader.normalizeDir(solrHome));
|
||||
if (!solrHomeFile.exists()) {
|
||||
//Its very unlikely that solrHome would not exist so we will log an error
|
||||
//but continue because solr.content.dir may be specified, so it keeps working
|
||||
log.error(solrHomeFile.getAbsolutePath()+ " does not exist.");
|
||||
}
|
||||
String path = solrHomeFile.getParent()+"/"+CONTENT_STORE;
|
||||
File rootFile = new File(ConfigUtil.locateProperty("solr.content.dir", path));
|
||||
|
||||
try
|
||||
|
||||
@@ -241,4 +241,10 @@ public class SolrContentStoreTest
|
||||
document = solrContentStore.retrieveDocFromSolrContentStore(DEFAULT_TENANT, 0);
|
||||
Assert.assertNull(document);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nonExistentSolrHome() throws IOException {
|
||||
SolrContentStore solrContentStore = new SolrContentStore("bob");
|
||||
Assert.assertNotNull(solrContentStore);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user