Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » index » [javadoc | source]
org.apache.lucene.index
public class: MultiReader [javadoc | source]
java.lang.Object
   org.apache.lucene.index.IndexReader
      org.apache.lucene.index.MultiReader

All Implemented Interfaces:
    Cloneable, Closeable

An IndexReader which reads multiple indexes, appending their content.
Field Summary
protected  IndexReader[] subReaders     
Fields inherited from org.apache.lucene.index.IndexReader:
hasChanges,  DEFAULT_TERMS_INDEX_DIVISOR
Constructor:
 public MultiReader(IndexReader subReaders) 

    Construct a MultiReader aggregating the named set of (sub)readers. Directory locking for delete, undeleteAll, and setNorm operations is left to the subreaders.

    Note that all subreaders are closed if this Multireader is closed.

    Parameters:
    subReaders - set of (sub)readers
    Throws:
    IOException -
 public MultiReader(IndexReader[] subReaders,
    boolean closeSubReaders) 

    Construct a MultiReader aggregating the named set of (sub)readers. Directory locking for delete, undeleteAll, and setNorm operations is left to the subreaders.

    Parameters:
    closeSubReaders - indicates whether the subreaders should be closed when this MultiReader is closed
    subReaders - set of (sub)readers
    Throws:
    IOException -
Method from org.apache.lucene.index.MultiReader Summary:
clone,   doClose,   doCommit,   doDelete,   doReopen,   doSetNorm,   doUndeleteAll,   docFreq,   document,   getFieldNames,   getSequentialSubReaders,   getTermFreqVector,   getTermFreqVector,   getTermFreqVector,   getTermFreqVectors,   getVersion,   hasDeletions,   hasNorms,   isCurrent,   isDeleted,   isOptimized,   maxDoc,   norms,   norms,   numDocs,   reopen,   termDocs,   termPositions,   terms,   terms
Methods from org.apache.lucene.index.IndexReader:
acquireWriteLock,   clone,   clone,   close,   commit,   commit,   decRef,   deleteDocument,   deleteDocuments,   directory,   doClose,   doCommit,   doDelete,   doSetNorm,   doUndeleteAll,   docFreq,   document,   document,   ensureOpen,   flush,   flush,   getCommitUserData,   getCommitUserData,   getCurrentVersion,   getFieldCacheKey,   getFieldNames,   getIndexCommit,   getRefCount,   getSequentialSubReaders,   getTermFreqVector,   getTermFreqVector,   getTermFreqVector,   getTermFreqVectors,   getTermInfosIndexDivisor,   getUniqueTermCount,   getVersion,   hasDeletions,   hasNorms,   incRef,   indexExists,   isCurrent,   isDeleted,   isOptimized,   lastModified,   listCommits,   main,   maxDoc,   norms,   norms,   numDeletedDocs,   numDocs,   open,   open,   open,   open,   open,   open,   open,   reopen,   reopen,   reopen,   setNorm,   setNorm,   termDocs,   termDocs,   termPositions,   termPositions,   terms,   terms,   undeleteAll
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.index.MultiReader Detail:
 public synchronized Object clone() 
    Clones the subreaders. (see IndexReader#clone() ).

    If subreaders are shared, then the reference count of those readers is increased to ensure that the subreaders remain open until the last referring reader is closed.

 protected synchronized  void doClose() throws IOException 
 protected  void doCommit(Map<String, String> commitUserData) throws IOException 
 protected  void doDelete(int n) throws CorruptIndexException, IOException 
 protected IndexReader doReopen(boolean doClone) throws CorruptIndexException, IOException 
    If clone is true then we clone each of the subreaders
 protected  void doSetNorm(int n,
    String field,
    byte value) throws CorruptIndexException, IOException 
 protected  void doUndeleteAll() throws CorruptIndexException, IOException 
 public int docFreq(Term t) throws IOException 
 public Document document(int n,
    FieldSelector fieldSelector) throws CorruptIndexException, IOException 
 public Collection<String> getFieldNames(FieldOption fieldNames) 
 public IndexReader[] getSequentialSubReaders() 
 public TermFreqVector getTermFreqVector(int n,
    String field) throws IOException 
 public  void getTermFreqVector(int docNumber,
    TermVectorMapper mapper) throws IOException 
 public  void getTermFreqVector(int docNumber,
    String field,
    TermVectorMapper mapper) throws IOException 
 public TermFreqVector[] getTermFreqVectors(int n) throws IOException 
 public long getVersion() 
    Not implemented.
 public boolean hasDeletions() 
 public boolean hasNorms(String field) throws IOException 
 public boolean isCurrent() throws CorruptIndexException, IOException 
    Checks recursively if all subreaders are up to date.
 public boolean isDeleted(int n) 
 public boolean isOptimized() 
 public int maxDoc() 
 public synchronized byte[] norms(String field) throws IOException 
 public synchronized  void norms(String field,
    byte[] result,
    int offset) throws IOException 
 public synchronized int numDocs() 
 public synchronized IndexReader reopen() throws CorruptIndexException, IOException 
    Tries to reopen the subreaders.
    If one or more subreaders could be re-opened (i. e. subReader.reopen() returned a new instance != subReader), then a new MultiReader instance is returned, otherwise this instance is returned.

    A re-opened instance might share one or more subreaders with the old instance. Index modification operations result in undefined behavior when performed before the old instance is closed. (see IndexReader#reopen() ).

    If subreaders are shared, then the reference count of those readers is increased to ensure that the subreaders remain open until the last referring reader is closed.

 public TermDocs termDocs() throws IOException 
 public TermPositions termPositions() throws IOException 
 public TermEnum terms() throws IOException 
 public TermEnum terms(Term term) throws IOException