Package org.apache.lucene.index

# Class FilterCodecReader

java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.LeafReader
org.apache.lucene.index.CodecReader
org.apache.lucene.index.FilterCodecReader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `SortingCodecReader`

public abstract class FilterCodecReader extends CodecReader
A `FilterCodecReader` contains another CodecReader, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.

NOTE: If this `FilterCodecReader` does not change the content the contained reader, you could consider delegating calls to `LeafReader.getCoreCacheHelper()` and `IndexReader.getReaderCacheHelper()`.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader

`IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final CodecReader`
`in`
The underlying CodecReader instance.

## Constructor Summary

Constructors
Constructor
Description
`FilterCodecReader(CodecReader in)`
Creates a new FilterCodecReader.

## Method Summary

Modifier and Type
Method
Description
`void`
`checkIntegrity()`
Checks consistency of this reader.
`protected void`
`doClose()`
Implements close.
`CodecReader`
`getDelegate()`
Returns the wrapped `CodecReader`.
`DocValuesProducer`
`getDocValuesReader()`
Expert: retrieve underlying DocValuesProducer
`FieldInfos`
`getFieldInfos()`
Get the `FieldInfos` describing all fields in this reader.
`StoredFieldsReader`
`getFieldsReader()`
Expert: retrieve underlying StoredFieldsReader
`Bits`
`getLiveDocs()`
Returns the `Bits` representing live (not deleted) docs.
`LeafMetaData`
`getMetaData()`
Return metadata about this leaf.
`NormsProducer`
`getNormsReader()`
Expert: retrieve underlying NormsProducer
`PointsReader`
`getPointsReader()`
Expert: retrieve underlying PointsReader
`FieldsProducer`
`getPostingsReader()`
Expert: retrieve underlying FieldsProducer
`TermVectorsReader`
`getTermVectorsReader()`
Expert: retrieve underlying TermVectorsReader
`KnnVectorsReader`
`getVectorReader()`
Expert: retrieve underlying VectorReader
`int`
`maxDoc()`
Returns one greater than the largest possible document number.
`int`
`numDocs()`
Returns the number of documents in this index.
`static CodecReader`
`unwrap(CodecReader reader)`
Get the wrapped instance by `reader` as long as this reader is an instance of `FilterCodecReader`.

### Methods inherited from class org.apache.lucene.index.CodecReader

`getBinaryDocValues, getByteVectorValues, getDocValuesSkipper, getFloatVectorValues, getNormValues, getNumericDocValues, getPointValues, getSortedDocValues, getSortedNumericDocValues, getSortedSetDocValues, searchNearestVectors, searchNearestVectors, storedFields, terms, termVectors`

### Methods inherited from class org.apache.lucene.index.LeafReader

`docFreq, getContext, getCoreCacheHelper, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, searchNearestVectors, searchNearestVectors, totalTermFreq`

### Methods inherited from class org.apache.lucene.index.IndexReader

`close, decRef, ensureOpen, equals, getReaderCacheHelper, getRefCount, hasDeletions, hashCode, incRef, leaves, notifyReaderClosedListeners, numDeletedDocs, registerParentReader, tryIncRef`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### in

protected final CodecReader in
The underlying CodecReader instance.

## Constructor Details

### FilterCodecReader

public FilterCodecReader(CodecReader in)
Creates a new FilterCodecReader.

Parameters:
  `in` - the underlying CodecReader instance.

## Method Details

### unwrap

public static CodecReader unwrap(CodecReader reader)
Get the wrapped instance by `reader` as long as this reader is an instance of `FilterCodecReader`.

### getFieldsReader

public StoredFieldsReader getFieldsReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying StoredFieldsReader

Specified by:
  `getFieldsReader` in class `CodecReader`

### getTermVectorsReader

public TermVectorsReader getTermVectorsReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying TermVectorsReader

Specified by:
  `getTermVectorsReader` in class `CodecReader`

### getNormsReader

public NormsProducer getNormsReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying NormsProducer

Specified by:
  `getNormsReader` in class `CodecReader`

### getDocValuesReader

public DocValuesProducer getDocValuesReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying DocValuesProducer

Specified by:
  `getDocValuesReader` in class `CodecReader`

### getPostingsReader

public FieldsProducer getPostingsReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying FieldsProducer

Specified by:
  `getPostingsReader` in class `CodecReader`

### getLiveDocs

public Bits getLiveDocs()
Description copied from class: `LeafReader`
Returns the `Bits` representing live (not deleted) docs. A set bit indicates the doc ID has not been deleted. If this method returns null it means there are no deleted documents (all documents are live).

The returned instance has been safely published for use by multiple threads without additional synchronization.

Specified by:
  `getLiveDocs` in class `LeafReader`

### getFieldInfos

public FieldInfos getFieldInfos()
Description copied from class: `LeafReader`
Get the `FieldInfos` describing all fields in this reader.

Note: Implementations should cache the FieldInfos instance returned by this method such that subsequent calls to this method return the same instance.

Specified by:
  `getFieldInfos` in class `LeafReader`

### getPointsReader

public PointsReader getPointsReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying PointsReader

Specified by:
  `getPointsReader` in class `CodecReader`

### getVectorReader

public KnnVectorsReader getVectorReader()
Description copied from class: `CodecReader`
Expert: retrieve underlying VectorReader

Specified by:
  `getVectorReader` in class `CodecReader`

### numDocs

public int numDocs()
Description copied from class: `IndexReader`
Returns the number of documents in this index.

NOTE: This operation may run in O(maxDoc). Implementations that can't return this number in constant-time should cache it.

Specified by:
  `numDocs` in class `IndexReader`

### maxDoc

public int maxDoc()
Description copied from class: `IndexReader`
Returns one greater than the largest possible document number. This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.

Specified by:
  `maxDoc` in class `IndexReader`

### getMetaData

public LeafMetaData getMetaData()
Description copied from class: `LeafReader`
Return metadata about this leaf.

Specified by:
  `getMetaData` in class `LeafReader`

### doClose

protected void doClose() throws IOException
Description copied from class: `IndexReader`
Implements close.

Overrides:
  `doClose` in class `CodecReader`
Throws:
  `IOException`

### checkIntegrity

public void checkIntegrity() throws IOException
Description copied from class: `LeafReader`
Checks consistency of this reader.

Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

Overrides:
  `checkIntegrity` in class `CodecReader`
Throws:
  `IOException`

### getDelegate

public CodecReader getDelegate()
Returns the wrapped `CodecReader`.