Class IdFieldMapper

All Implemented Interfaces:
Iterable<Mapper>, ToXContent, ToXContentFragment
Direct Known Subclasses:
ProvidedIdFieldMapper, TsidExtractingIdFieldMapper

public abstract class IdFieldMapper extends MetadataFieldMapper
A mapper for the _id field.
  • Field Details

  • Constructor Details

  • Method Details

    • indexAnalyzers

      public Map<String,NamedAnalyzer> indexAnalyzers()
      Overrides:
      indexAnalyzers in class FieldMapper
    • contentType

      protected final String contentType()
      Specified by:
      contentType in class FieldMapper
    • documentDescription

      public abstract String documentDescription(DocumentParserContext context)
      Description of the document being parsed used in error messages. Not called unless there is an error.
    • documentDescription

      public abstract String documentDescription(ParsedDocument parsedDocument)
      Description of the document being indexed used after parsing for things like version conflicts.
    • reindexId

      public abstract String reindexId(String id)
      Build the _id to use on requests reindexing into indices using this _id.
    • standardIdField

      public static org.apache.lucene.document.Field standardIdField(String id)
      Create an indexed and stored Field for the provided _id.
    • standardIdField

      public static org.apache.lucene.document.Field standardIdField(org.apache.lucene.util.BytesRef uid, org.apache.lucene.document.Field.Store stored)
      Create an indexed Field for the provided _id, optionally stored. The id must already be encoded using Uid.encodeId(String).
    • syntheticIdField

      public static org.apache.lucene.document.Field syntheticIdField(String id)
      Create a Field corresponding to a synthetic _id field, which is not indexed and not stored but instead computed at runtime.
    • syntheticIdField

      public static org.apache.lucene.document.Field syntheticIdField(org.apache.lucene.util.BytesRef uid)
      Create a Field corresponding to a synthetic _id field, which is not indexed and not stored but instead resolved at runtime. The id must be already encoded using Uid.encodeId(String).