public final class MergingDirectoryReaderWrapper extends FilterDirectoryReader
DirectoryReader
wrapper that uses the merge instances of the wrapped
CodecReader
s.
NOTE: This class will fail to work if the leaves of the wrapped directory are
not codec readers.FilterDirectoryReader.SubReaderWrapper
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener
in
directory
Constructor and Description |
---|
MergingDirectoryReaderWrapper(DirectoryReader in)
Wrap the given directory.
|
Modifier and Type | Method and Description |
---|---|
protected DirectoryReader |
doWrapDirectoryReader(DirectoryReader in)
Called by the doOpenIfChanged() methods to return a new wrapped DirectoryReader.
|
IndexReader.CacheHelper |
getReaderCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this reader. |
doClose, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, getDelegate, getIndexCommit, getVersion, isCurrent, unwrap
directory, indexExists, listCommits, open, open, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged
docFreq, document, getDocCount, getSequentialSubReaders, getSumDocFreq, getSumTotalTermFreq, getTermVectors, maxDoc, numDocs, readerBase, readerIndex, totalTermFreq
getContext, toString
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, tryIncRef
public MergingDirectoryReaderWrapper(DirectoryReader in) throws java.io.IOException
java.io.IOException
protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws java.io.IOException
FilterDirectoryReader
doWrapDirectoryReader
in class FilterDirectoryReader
in
- the DirectoryReader to wrapjava.io.IOException
public IndexReader.CacheHelper getReaderCacheHelper()
IndexReader
IndexReader.CacheHelper
that can be used to cache
based on the content of this reader. Two readers that have different data
or different sets of deleted documents will be considered different.
A return value of null
indicates that this reader is not suited
for caching, which is typically the case for short-lived wrappers that
alter the content of the wrapped reader.
getReaderCacheHelper
in class IndexReader
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.