Java Code Examples for org.apache.solr.core.SolrResourceLoader#locateSolrHome()

The following examples show how to use org.apache.solr.core.SolrResourceLoader#locateSolrHome() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandardIndexTokenizerFactory.java    From mecab-ko-lucene-analyzer with Apache License 2.0 5 votes vote down vote up
private void setMeCabDicDir(Map<String,String> args) {
  String path = get(
      args,
      "mecabDicDir",
      StandardIndexTokenizerFactory.DEFAULT_MECAB_DIC_DIR);
  if (path != null) {
    if (path.startsWith("/")) {
      mecabDicDir = path;
    } else {
      mecabDicDir = SolrResourceLoader.locateSolrHome() + path;
    }
  }
}
 
Example 2
Source File: StandardQueryTokenizerFactory.java    From mecab-ko-lucene-analyzer with Apache License 2.0 5 votes vote down vote up
private void setMeCabDicDir(Map<String,String> args) {
  String path = get(
      args,
      "mecabDicDir",
      StandardIndexTokenizerFactory.DEFAULT_MECAB_DIC_DIR);
  if (path != null) {
    if (path.startsWith("/")) {
      mecabDicDir = path;
    } else {
      mecabDicDir = SolrResourceLoader.locateSolrHome() + path;
    }
  }
}
 
Example 3
Source File: Factory.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public SolrClient create(String spec) {
	Path solrHome = SolrResourceLoader.locateSolrHome();
	Path configFile = solrHome.resolve(SolrXmlConfig.SOLR_XML_FILE);
	return new EmbeddedSolrServer(CoreContainer.createAndLoad(solrHome, configFile), "embedded");
}