Class SearchIndex.CombinedIndexReader

  extended by org.apache.lucene.index.IndexReader
      extended by org.apache.lucene.index.MultiReader
          extended by org.apache.jackrabbit.core.query.lucene.SearchIndex.CombinedIndexReader
All Implemented Interfaces:
HierarchyResolver, MultiIndexReader, ReleaseableIndexReader
Enclosing class:

protected static final class SearchIndex.CombinedIndexReader
extends org.apache.lucene.index.MultiReader
implements HierarchyResolver, MultiIndexReader

Combines multiple CachingMultiIndexReader into a MultiReader with HierarchyResolver support.

Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
Field Summary
Fields inherited from class org.apache.lucene.index.IndexReader
Constructor Summary
SearchIndex.CombinedIndexReader(CachingMultiIndexReader[] indexReaders)
Method Summary
 org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId createDocId(UUID uuid)
          Creates a document id for the given uuid.
 boolean equals(Object obj)
 int getDocumentNumber(org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId docId)
          Returns the document number for the passed docId.
 org.apache.lucene.index.IndexReader[] getIndexReaders()
 int[] getParents(int n, int[] docNumbers)
          Returns the document number of the parent of n or an empty array if n does not have a parent (n is the root node).
 int hashCode()
 void release()
          Releases this index reader and potentially frees resources.
Methods inherited from class org.apache.lucene.index.MultiReader
docFreq, doClose, doCommit, document, doDelete, doSetNorm, doUndeleteAll, getFieldNames, getTermFreqVector, getTermFreqVector, getTermFreqVector, getTermFreqVectors, getVersion, hasDeletions, hasNorms, isCurrent, isDeleted, isOptimized, maxDoc, norms, norms, numDocs, reopen, termDocs, termPositions, terms, terms
Methods inherited from class org.apache.lucene.index.IndexReader
acquireWriteLock, close, commit, decRef, deleteDocument, deleteDocuments, directory, document, ensureOpen, flush, getCurrentVersion, getCurrentVersion, getCurrentVersion, getIndexCommit, getTermInfosIndexDivisor, incRef, indexExists, indexExists, indexExists, isLocked, isLocked, lastModified, lastModified, lastModified, listCommits, main, numDeletedDocs, open, open, open, open, open, open, open, open, open, setNorm, setNorm, setTermInfosIndexDivisor, termDocs, termPositions, undeleteAll, unlock
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SearchIndex.CombinedIndexReader(CachingMultiIndexReader[] indexReaders)
Method Detail


public int[] getParents(int n,
                        int[] docNumbers)
                 throws IOException
Description copied from interface: HierarchyResolver
Returns the document number of the parent of n or an empty array if n does not have a parent (n is the root node).

Specified by:
getParents in interface HierarchyResolver
n - the document number.
docNumbers - an array for reuse. An implementation should use the passed array as a container for the return value, unless the length of the returned array is different from docNumbers. In which case an implementation will create a new array with an appropriate size.
the document number of n's parent.
IOException - if an error occurs while reading from the index.


public org.apache.lucene.index.IndexReader[] getIndexReaders()

Specified by:
getIndexReaders in interface MultiIndexReader
the IndexReaders that are contained in this MultiIndexReader.


public void release()
             throws IOException
Releases this index reader and potentially frees resources. In contrast to IndexReader.close() this method does not necessarily close the index reader, but gives the implementation the opportunity to do reference counting.

Specified by:
release in interface ReleaseableIndexReader
IOException - if an error occurs while releasing the index reader.


public boolean equals(Object obj)
equals in class Object


public int hashCode()
hashCode in class Object


public org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId createDocId(UUID uuid)
                                                                        throws IOException
Creates a document id for the given uuid.

Specified by:
createDocId in interface MultiIndexReader
uuid - the uuid of the node.
a foreign segment doc id or null if there is no node with the given uuid.
IOException - if an error occurs while reading from the index.


public int getDocumentNumber(org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId docId)
Returns the document number for the passed docId. If the id is invalid -1 is returned.

Specified by:
getDocumentNumber in interface MultiIndexReader
docId - the document id to resolve.
the document number or -1 if it is invalid (e.g. does not exist).

Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.