Class PerFieldMapperCodec

java.lang.Object
org.apache.lucene.codecs.Codec
org.apache.lucene.codecs.FilterCodec
org.elasticsearch.index.codec.Elasticsearch814Codec
org.elasticsearch.index.codec.PerFieldMapperCodec
All Implemented Interfaces:
org.apache.lucene.util.NamedSPILoader.NamedSPI

public final class PerFieldMapperCodec extends Elasticsearch814Codec
This Lucene codec provides the default PostingsFormat and KnnVectorsFormat for Elasticsearch. It utilizes the MapperService to lookup a PostingsFormat and KnnVectorsFormat per field. This allows users to change the low level postings format and vectors format for individual fields per index in real time via the mapping API. If no specific postings format or vector format is configured for a specific field the default postings or vector format is used.
  • Constructor Details

  • Method Details

    • getPostingsFormatForField

      public org.apache.lucene.codecs.PostingsFormat getPostingsFormatForField(String field)
      Description copied from class: Elasticsearch814Codec
      Returns the postings format that should be used for writing new segments of field.

      The default implementation always returns "Lucene99".

      WARNING: if you subclass, you are responsible for index backwards compatibility: future version of Lucene are only guaranteed to be able to read the default implementation,

      Overrides:
      getPostingsFormatForField in class Elasticsearch814Codec
    • getKnnVectorsFormatForField

      public org.apache.lucene.codecs.KnnVectorsFormat getKnnVectorsFormatForField(String field)
      Description copied from class: Elasticsearch814Codec
      Returns the vectors format that should be used for writing new segments of field

      The default implementation always returns "Lucene95".

      WARNING: if you subclass, you are responsible for index backwards compatibility: future version of Lucene are only guaranteed to be able to read the default implementation.

      Overrides:
      getKnnVectorsFormatForField in class Elasticsearch814Codec
    • getDocValuesFormatForField

      public org.apache.lucene.codecs.DocValuesFormat getDocValuesFormatForField(String field)
      Description copied from class: Elasticsearch814Codec
      Returns the docvalues format that should be used for writing new segments of field .

      The default implementation always returns "Lucene99".

      WARNING: if you subclass, you are responsible for index backwards compatibility: future version of Lucene are only guaranteed to be able to read the default implementation.

      Overrides:
      getDocValuesFormatForField in class Elasticsearch814Codec