public static Dictionary getDict(String dicPath, ResourceLoader loader) { Dictionary dic = null; if(dicPath != null) { File f = new File(dicPath); if(!f.isAbsolute() && loader instanceof SolrResourceLoader) { //相对目录 SolrResourceLoader srl = (SolrResourceLoader) loader; dicPath = srl.getInstancePath().resolve(dicPath).toString(); f = new File(dicPath); } dic = Dictionary.getInstance(f); } else { dic = Dictionary.getInstance(); } return dic; } }
public static Dictionary getDict(String dicPath, ResourceLoader loader) { Dictionary dic = null; if(dicPath != null) { File f = new File(dicPath); if(!f.isAbsolute() && loader instanceof SolrResourceLoader) { //相对目录 SolrResourceLoader srl = (SolrResourceLoader) loader; dicPath = srl.getInstancePath().resolve(dicPath).toString(); f = new File(dicPath); } dic = Dictionary.getInstance(f); } else { dic = Dictionary.getInstance(); } return dic; } }
.format(Locale.ENGLISH, "Constructed instance information solr.home %s (%s), instance dir %s, conf dir %s, writing index to solr.data.dir %s, with permdir %s", solrHomeDir, solrHomeDir.toUri(), loader.getInstancePath(), loader.getConfigDir(), dataDirStr, outputShardDir));
.format(Locale.ENGLISH, "Constructed instance information solr.home %s (%s), instance dir %s, conf dir %s, writing index to solr.data.dir %s, with permdir %s", solrHomeDir, solrHomeDir.toUri(), loader.getInstancePath(), loader.getConfigDir(), dataDirStr, outputShardDir));
.format(Locale.ENGLISH, "Constructed instance information solr.home %s (%s), instance dir %s, conf dir %s, writing index to solr.data.dir %s, with permdir %s", solrHomeDir, solrHomeDir.toUri(), loader.getInstancePath(), loader.getConfigDir(), dataDirStr, outputShardDir));
public static CoreContainer createCoreContainer(NodeConfig config, CoresLocator locator) { testSolrHome = config.getSolrResourceLoader().getInstancePath(); h = new TestHarness(config, locator); lrf = h.getRequestFactory("", 0, 20, CommonParams.VERSION, "2.2"); return h.getCoreContainer(); }