Save This Page
Home » lucene-2.4.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
An IndexReader which reads multiple indexes, appending their content.
Field Summary
protected  IndexReader[] subReaders     
Fields inherited from org.apache.lucene.index.IndexReader:
READ_ONLY_DEFAULT,  hasChanges
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:
doClose,   doCommit,   doDelete,   doSetNorm,   doUndeleteAll,   docFreq,   document,   getFieldNames,   getSubReaders,   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,   close,   commit,   decRef,   deleteDocument,   deleteDocuments,   directory,   doClose,   doCommit,   doDelete,   doSetNorm,   doUndeleteAll,   docFreq,   document,   document,   ensureOpen,   flush,   getCurrentVersion,   getCurrentVersion,   getCurrentVersion,   getFieldNames,   getIndexCommit,   getRefCount,   getTermFreqVector,   getTermFreqVector,   getTermFreqVector,   getTermFreqVectors,   getTermInfosIndexDivisor,   getVersion,   hasDeletions,   hasNorms,   incRef,   indexExists,   indexExists,   indexExists,   isCurrent,   isDeleted,   isLocked,   isLocked,   isOptimized,   lastModified,   lastModified,   lastModified,   listCommits,   main,   maxDoc,   norms,   norms,   numDeletedDocs,   numDocs,   open,   open,   open,   open,   open,   open,   open,   open,   open,   reopen,   setNorm,   setNorm,   setTermInfosIndexDivisor,   termDocs,   termDocs,   termPositions,   termPositions,   terms,   terms,   undeleteAll,   unlock
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.index.MultiReader Detail:
 protected synchronized  void doClose() throws IOException 
 protected  void doCommit() throws IOException 
 protected  void doDelete(int n) throws IOException, CorruptIndexException 
 protected  void doSetNorm(int n,
    String field,
    byte value) throws IOException, CorruptIndexException 
 protected  void doUndeleteAll() throws IOException, CorruptIndexException 
 public int docFreq(Term t) throws IOException 
 public Document document(int n,
    FieldSelector fieldSelector) throws IOException, CorruptIndexException 
 public Collection getFieldNames(IndexReader.FieldOption fieldNames) 
 IndexReader[] getSubReaders() 
 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 IOException, CorruptIndexException 
    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 IndexReader reopen() throws IOException, CorruptIndexException 
    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