Class PerFieldMapperCodec

java.lang.Object
org.apache.lucene.codecs.Codec
org.apache.lucene.codecs.FilterCodec
All Implemented Interfaces:
org.apache.lucene.util.NamedSPILoader.NamedSPI

public final class PerFieldMapperCodec extends Elasticsearch900Lucene101Codec
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: Elasticsearch900Lucene101Codec
      Returns the postings format that should be used for writing new segments of field.

      The default implementation always returns "Lucene912".

      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 Elasticsearch900Lucene101Codec
    • getKnnVectorsFormatForField

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

      The default implementation always returns "Lucene912".

      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 Elasticsearch900Lucene101Codec
    • getDocValuesFormatForField

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

      The default implementation always returns "Lucene912".

      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 Elasticsearch900Lucene101Codec