if (!(core.getDirectoryFactory() instanceof HdfsDirectoryFactory)) { throw new UnsupportedOperationException( "Invalid configuration. Currently, the only DirectoryFactory supported is "
if (!(core.getDirectoryFactory() instanceof HdfsDirectoryFactory)) { throw new UnsupportedOperationException( "Invalid configuration. Currently, the only DirectoryFactory supported is "
if (!(core.getDirectoryFactory() instanceof HdfsDirectoryFactory)) { throw new UnsupportedOperationException( "Invalid configuration. Currently, the only DirectoryFactory supported is "
/** Creates a searcher searching the index in the named directory. * * @deprecated use alternate constructor */ public SolrIndexSearcher(SolrCore core, IndexSchema schema, String name, String path, boolean enableCache) throws IOException { this(core, schema,name, core.getIndexReaderFactory().newReader(core.getDirectoryFactory().open(path), false), true, enableCache); }
SolrCore core = container.create(descr); if (!(core.getDirectoryFactory() instanceof HdfsDirectoryFactory)) { throw new UnsupportedOperationException( "Invalid configuration. Currently, the only DirectoryFactory supported is "
protected SolrIndexWriter createMainIndexWriter(String name, boolean removeAllExisting) throws IOException { return new SolrIndexWriter(name,core.getNewIndexDir(), core.getDirectoryFactory(), removeAllExisting, schema, core.getSolrConfig().mainIndexConfig, core.getDeletionPolicy()); }
Directory dir = SolrIndexWriter.getDirectory(getIndexDir(), getDirectoryFactory(), solrConfig.mainIndexConfig); if (dir != null) { if (IndexWriter.isLocked(dir)) { + " Creating new index..."); SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex", getIndexDir(), getDirectoryFactory(), true, schema, solrConfig.mainIndexConfig, solrDelPolicy); writer.close();
IndexReader reader = getIndexReaderFactory().newReader(getDirectoryFactory().open(newIndexDir), true); tmp = new SolrIndexSearcher(this, schema, "main", reader, true, true);
protected boolean handleMergeAction(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException { boolean doPersist = false; SolrParams params = req.getParams(); SolrParams required = params.required(); String cname = required.get(CoreAdminParams.CORE); SolrCore core = coreContainer.getCore(cname); if (core != null) { try { doPersist = coreContainer.isPersistent(); String[] dirNames = required.getParams(CoreAdminParams.INDEX_DIR); DirectoryFactory dirFactory = core.getDirectoryFactory(); Directory[] dirs = new Directory[dirNames.length]; for (int i = 0; i < dirNames.length; i++) { dirs[i] = dirFactory.open(dirNames[i]); } UpdateRequestProcessorChain processorChain = core.getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR)); SolrQueryRequest wrappedReq = new LocalSolrQueryRequest(core, req.getParams()); UpdateRequestProcessor processor = processorChain.createProcessor(wrappedReq, rsp); processor.processMergeIndexes(new MergeIndexesCommand(dirs)); } finally { core.close(); } } return doPersist; }