public class PruningReader extends FilterIndexReader
TermPruningPolicy, and
optionally it can also remove stored fields of documents according to rules
implemented in a StorePruningPolicy.FilterIndexReader.FilterTermDocs, FilterIndexReader.FilterTermEnum, FilterIndexReader.FilterTermPositionsIndexReader.ReaderClosedListener| Modifier and Type | Field and Description |
|---|---|
protected int |
delTermCount |
protected int |
delVecCount |
protected int |
docCount |
protected int |
prunedVecCount |
protected StorePruningPolicy |
storePolicy |
protected int |
termCount |
protected TermPruningPolicy |
termPolicy |
protected int |
vecCount |
inhasChanges| Constructor and Description |
|---|
PruningReader(IndexReader in,
StorePruningPolicy storePolicy,
TermPruningPolicy termPolicy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Document |
document(int n,
FieldSelector fieldSelector)
Applies a
StorePruningPolicy to stored fields of a document. |
FieldInfos |
getFieldInfos()
Applies a
StorePruningPolicy to the list of available field infos. |
IndexReader[] |
getSequentialSubReaders()
Expert: returns the sequential sub readers that this
reader is logically composed of.
|
TermFreqVector[] |
getTermFreqVectors(int docNumber)
Applies
TermPruningPolicy to terms inside term vectors. |
TermPositions |
termPositions()
Applies
TermPruningPolicy to term positions. |
TermEnum |
terms()
Applies
TermPruningPolicy to term enum. |
directory, docFreq, doClose, doCommit, doDelete, doSetNorm, doUndeleteAll, getCommitUserData, getCoreCacheKey, getDeletesCacheKey, getIndexCommit, getTermFreqVector, getTermFreqVector, getTermFreqVector, getTermInfosIndexDivisor, getUniqueTermCount, getVersion, hasDeletions, hasNorms, isCurrent, isDeleted, isOptimized, maxDoc, norms, norms, numDocs, termDocs, termDocs, terms, toStringacquireWriteLock, addReaderClosedListener, clone, clone, close, commit, commit, decRef, deleteDocument, deleteDocuments, document, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, ensureOpen, flush, flush, getCommitUserData, getCurrentVersion, getRefCount, incRef, indexExists, lastModified, listCommits, numDeletedDocs, open, open, open, open, open, open, open, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged, removeReaderClosedListener, reopen, reopen, reopen, reopen, setNorm, setNorm, termPositions, tryIncRef, undeleteAllprotected int docCount
protected int vecCount
protected int termCount
protected int delTermCount
protected int prunedVecCount
protected int delVecCount
protected TermPruningPolicy termPolicy
protected StorePruningPolicy storePolicy
public PruningReader(IndexReader in, StorePruningPolicy storePolicy, TermPruningPolicy termPolicy)
in - input readerstorePolicy - implementation of StorePruningPolicy - if null
then stored values will be retained as is.termPolicy - implementation of TermPruningPolicy, must not
be null.public IndexReader[] getSequentialSubReaders()
IndexReader
NOTE: You should not try using sub-readers returned by
this method to make any changes (setNorm, deleteDocument,
etc.). While this might succeed for one composite reader
(like MultiReader), it will most likely lead to index
corruption for other readers (like DirectoryReader obtained
through IndexReader.open(org.apache.lucene.store.Directory). Use the parent reader directly.
getSequentialSubReaders in class FilterIndexReaderpublic Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException
StorePruningPolicy to stored fields of a document.document in class FilterIndexReadern - Get the document at the nth positionfieldSelector - The FieldSelector to use to determine what
Fields should be loaded on the Document. May be null, in which case
all Fields will be loaded.Document at the nth positionCorruptIndexException - if the index is corruptIOException - if there is a low-level IO errorFieldable,
FieldSelector,
SetBasedFieldSelector,
LoadFirstFieldSelectorpublic FieldInfos getFieldInfos()
StorePruningPolicy to the list of available field infos.getFieldInfos in class FilterIndexReaderpublic TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException
TermPruningPolicy to terms inside term vectors.getTermFreqVectors in class FilterIndexReaderdocNumber - document for which term frequency vectors are returnedIOException - if index cannot be accessedField.TermVectorpublic TermPositions termPositions() throws IOException
TermPruningPolicy to term positions.termPositions in class FilterIndexReaderIOException - if there is a low-level IO errorpublic TermEnum terms() throws IOException
TermPruningPolicy to term enum.terms in class FilterIndexReaderIOException - if there is a low-level IO error