org.apache.lucene.codecs.lucene42

## Class Lucene42Codec

- java.lang.Object
- - org.apache.lucene.codecs.Codec
  - - org.apache.lucene.codecs.lucene42.Lucene42Codec

All Implemented Interfaces:
  NamedSPILoader.NamedSPI

    public class Lucene42Codec
    extends Codec

Implements the Lucene 4.2 index format, with configurable per-field postings and docvalues formats.

If you want to reuse functionality of this codec in another codec, extend `FilterCodec`.

See Also:
  `package documentation for file format details.`
WARNING: This API is experimental and might change in incompatible ways in the next release.

### Constructor Summary

Constructors
Constructor and Description
`Lucene42Codec()` Sole constructor.

### Method Summary

Methods
`DocValuesFormat` `docValuesFormat()` Encodes/decodes docvalues
`FieldInfosFormat` `fieldInfosFormat()` Encodes/decodes field infos file
`DocValuesFormat` `getDocValuesFormatForField(String field)` Returns the docvalues format that should be used for writing new segments of `field`.
`PostingsFormat` `getPostingsFormatForField(String field)` Returns the postings format that should be used for writing new segments of `field`.
`LiveDocsFormat` `liveDocsFormat()` Encodes/decodes live docs
`NormsFormat` `normsFormat()` Encodes/decodes document normalization values
`PostingsFormat` `postingsFormat()` Encodes/decodes postings
`SegmentInfoFormat` `segmentInfoFormat()` Encodes/decodes segment info file
`StoredFieldsFormat` `storedFieldsFormat()` Encodes/decodes stored fields
`TermVectorsFormat` `termVectorsFormat()` Encodes/decodes term vectors

### Methods inherited from class org.apache.lucene.codecs.Codec

`availableCodecs, forName, getDefault, getName, reloadCodecs, setDefault, toString`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Lucene42Codec

    public Lucene42Codec()

Sole constructor.

### Method Detail

#### storedFieldsFormat

    public final StoredFieldsFormat storedFieldsFormat()

Description copied from class: `Codec`
Encodes/decodes stored fields

Specified by:
  `storedFieldsFormat` in class `Codec`

#### termVectorsFormat

    public final TermVectorsFormat termVectorsFormat()

Description copied from class: `Codec`
Encodes/decodes term vectors

Specified by:
  `termVectorsFormat` in class `Codec`

#### postingsFormat

    public final PostingsFormat postingsFormat()

Description copied from class: `Codec`
Encodes/decodes postings

Specified by:
  `postingsFormat` in class `Codec`

#### fieldInfosFormat

    public final FieldInfosFormat fieldInfosFormat()

Description copied from class: `Codec`
Encodes/decodes field infos file

Specified by:
  `fieldInfosFormat` in class `Codec`

#### segmentInfoFormat

    public final SegmentInfoFormat segmentInfoFormat()

Description copied from class: `Codec`
Encodes/decodes segment info file

Specified by:
  `segmentInfoFormat` in class `Codec`

#### liveDocsFormat

    public final LiveDocsFormat liveDocsFormat()

Description copied from class: `Codec`
Encodes/decodes live docs

Specified by:
  `liveDocsFormat` in class `Codec`

#### getPostingsFormatForField

    public PostingsFormat getPostingsFormatForField(String field)

Returns the postings format that should be used for writing new segments of `field`. The default implementation always returns "Lucene41"

#### getDocValuesFormatForField

    public DocValuesFormat getDocValuesFormatForField(String field)

Returns the docvalues format that should be used for writing new segments of `field`. The default implementation always returns "Lucene42"

#### docValuesFormat

    public final DocValuesFormat docValuesFormat()

Description copied from class: `Codec`
Encodes/decodes docvalues

Specified by:
  `docValuesFormat` in class `Codec`

#### normsFormat

    public final NormsFormat normsFormat()

Description copied from class: `Codec`
Encodes/decodes document normalization values

Specified by:
  `normsFormat` in class `Codec`