Package org.apache.solr.core
Class IndexReaderFactory
- java.lang.Object
-
- org.apache.solr.core.IndexReaderFactory
-
- All Implemented Interfaces:
NamedListInitializedPlugin
- Direct Known Subclasses:
StandardIndexReaderFactory
public abstract class IndexReaderFactory extends Object implements NamedListInitializedPlugin
Factory used to build a new IndexReader instance.
-
-
Constructor Summary
Constructors Constructor Description IndexReaderFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidinit(org.apache.solr.common.util.NamedList<?> args)init will be called just once, immediately after creation.abstract org.apache.lucene.index.DirectoryReadernewReader(org.apache.lucene.index.IndexWriter writer, SolrCore core)Creates a new IndexReader instance using the given IndexWriter.abstract org.apache.lucene.index.DirectoryReadernewReader(org.apache.lucene.store.Directory indexDir, SolrCore core)Creates a new IndexReader instance using the given Directory.
-
-
-
Method Detail
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
init will be called just once, immediately after creation.The args are user-level initialization parameters that may be specified when declaring an indexReaderFactory in solrconfig.xml
- Specified by:
initin interfaceNamedListInitializedPlugin- Parameters:
args- non-null list of initialization parameters (may be empty)
-
newReader
public abstract org.apache.lucene.index.DirectoryReader newReader(org.apache.lucene.store.Directory indexDir, SolrCore core) throws IOExceptionCreates a new IndexReader instance using the given Directory.- Parameters:
indexDir- indexDir index locationcore-SolrCoreinstance where this reader will be used. NOTE: this SolrCore instance may not be fully configured yet, but basic things likeSolrCore.getCoreDescriptor(),SolrCore.getLatestSchema()andSolrCore.getSolrConfig()are valid.- Returns:
- An IndexReader instance
- Throws:
IOException- If there is a low-level I/O error.
-
newReader
public abstract org.apache.lucene.index.DirectoryReader newReader(org.apache.lucene.index.IndexWriter writer, SolrCore core) throws IOExceptionCreates a new IndexReader instance using the given IndexWriter.This is used for opening the initial reader in NRT mode
- Parameters:
writer- IndexWritercore-SolrCoreinstance where this reader will be used. NOTE: this SolrCore instance may not be fully configured yet, but basic things likeSolrCore.getCoreDescriptor(),SolrCore.getLatestSchema()andSolrCore.getSolrConfig()are valid.- Returns:
- An IndexReader instance
- Throws:
IOException- If there is a low-level I/O error.
-
-