Package org.apache.lucene.codecs
Class FilterCodec
java.lang.Object
org.apache.lucene.codecs.Codec
org.apache.lucene.codecs.FilterCodec
- All Implemented Interfaces:
NamedSPILoader.NamedSPI
A codec that forwards all its method calls to another codec.
Extend this class when you need to reuse the functionality of an existing codec. For example,
if you want to build a codec that redefines LuceneMN's LiveDocsFormat
:
public final class CustomCodec extends FilterCodec { public CustomCodec() { super("CustomCodec", new LuceneMNCodec()); } public LiveDocsFormat liveDocsFormat() { return new CustomLiveDocsFormat(); } }
Please note: Don't call Codec.forName(java.lang.String)
from the no-arg constructor of your own
codec. When the SPI framework loads your own Codec as SPI component, SPI has not yet fully
initialized! If you want to extend another Codec, instantiate it directly by calling its
constructor.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FilterCodec
(String name, Codec delegate) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionEncodes/decodes compound filesEncodes/decodes docvaluesEncodes/decodes field infos fileEncodes/decodes numeric vector fieldsEncodes/decodes live docsEncodes/decodes document normalization valuesEncodes/decodes points indexEncodes/decodes postingsEncodes/decodes segment info fileEncodes/decodes stored fieldsEncodes/decodes term vectorsMethods inherited from class org.apache.lucene.codecs.Codec
availableCodecs, forName, getDefault, getName, reloadCodecs, setDefault, toString
-
Field Details
-
delegate
The codec to filter.
-
-
Constructor Details
-
FilterCodec
Sole constructor. When subclassing this codec, create a no-arg ctor and pass the delegate codec and a unique name to this ctor.
-
-
Method Details
-
docValuesFormat
Description copied from class:Codec
Encodes/decodes docvalues- Specified by:
docValuesFormat
in classCodec
-
fieldInfosFormat
Description copied from class:Codec
Encodes/decodes field infos file- Specified by:
fieldInfosFormat
in classCodec
-
liveDocsFormat
Description copied from class:Codec
Encodes/decodes live docs- Specified by:
liveDocsFormat
in classCodec
-
normsFormat
Description copied from class:Codec
Encodes/decodes document normalization values- Specified by:
normsFormat
in classCodec
-
postingsFormat
Description copied from class:Codec
Encodes/decodes postings- Specified by:
postingsFormat
in classCodec
-
segmentInfoFormat
Description copied from class:Codec
Encodes/decodes segment info file- Specified by:
segmentInfoFormat
in classCodec
-
storedFieldsFormat
Description copied from class:Codec
Encodes/decodes stored fields- Specified by:
storedFieldsFormat
in classCodec
-
termVectorsFormat
Description copied from class:Codec
Encodes/decodes term vectors- Specified by:
termVectorsFormat
in classCodec
-
compoundFormat
Description copied from class:Codec
Encodes/decodes compound files- Specified by:
compoundFormat
in classCodec
-
pointsFormat
Description copied from class:Codec
Encodes/decodes points index- Specified by:
pointsFormat
in classCodec
-
knnVectorsFormat
Description copied from class:Codec
Encodes/decodes numeric vector fields- Specified by:
knnVectorsFormat
in classCodec
-