Class FieldMapper.Builder

java.lang.Object
org.elasticsearch.index.mapper.Mapper.Builder
org.elasticsearch.index.mapper.FieldMapper.Builder
Direct Known Subclasses:
BinaryFieldMapper.Builder, BooleanFieldMapper.Builder, CompletionFieldMapper.Builder, DateFieldMapper.Builder, GeoPointFieldMapper.Builder, GeoShapeFieldMapper.Builder, IpFieldMapper.Builder, KeywordFieldMapper.Builder, LegacyGeoShapeFieldMapper.Builder, MetadataFieldMapper.Builder, NumberFieldMapper.Builder, RangeFieldMapper.Builder, TextFieldMapper.Builder
Enclosing class:
FieldMapper

public abstract static class FieldMapper.Builder
extends Mapper.Builder
A Builder for a ParametrizedFieldMapper
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected FieldMapper.CopyTo.Builder copyTo  
    protected FieldMapper.MultiFields.Builder multiFieldsBuilder  

    Fields inherited from class org.elasticsearch.index.mapper.Mapper.Builder

    name
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected Builder​(java.lang.String name)
    Creates a new Builder with a field name
  • Method Summary

    Modifier and Type Method Description
    abstract FieldMapper build​(ContentPath context)
    Returns a newly built mapper.
    protected java.lang.String buildFullName​(ContentPath contentPath)
    Builds the full name of the field, taking into account parent objects
    protected abstract java.util.List<FieldMapper.Parameter<?>> getParameters()  
    FieldMapper.Builder init​(FieldMapper initializer)
    Initialises all parameters from an existing mapper
    protected static ContentPath parentPath​(java.lang.String name)  
    void parse​(java.lang.String name, Mapper.TypeParser.ParserContext parserContext, java.util.Map<java.lang.String,​java.lang.Object> fieldNode)
    Parse mapping parameters from a map of mappings
    void toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean includeDefaults)
    Writes the current builder parameter values as XContent

    Methods inherited from class org.elasticsearch.index.mapper.Mapper.Builder

    name

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Builder

      protected Builder​(java.lang.String name)
      Creates a new Builder with a field name
  • Method Details

    • init

      public FieldMapper.Builder init​(FieldMapper initializer)
      Initialises all parameters from an existing mapper
    • getParameters

      protected abstract java.util.List<FieldMapper.Parameter<?>> getParameters()
      Returns:
      the list of parameters defined for this mapper
    • build

      public abstract FieldMapper build​(ContentPath context)
      Description copied from class: Mapper.Builder
      Returns a newly built mapper.
      Specified by:
      build in class Mapper.Builder
    • buildFullName

      protected java.lang.String buildFullName​(ContentPath contentPath)
      Builds the full name of the field, taking into account parent objects
    • toXContent

      public final void toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean includeDefaults) throws java.io.IOException
      Writes the current builder parameter values as XContent
      Throws:
      java.io.IOException
    • parse

      public final void parse​(java.lang.String name, Mapper.TypeParser.ParserContext parserContext, java.util.Map<java.lang.String,​java.lang.Object> fieldNode)
      Parse mapping parameters from a map of mappings
      Parameters:
      name - the field mapper name
      parserContext - the parser context
      fieldNode - the root node of the map of mappings for this field
    • parentPath

      protected static ContentPath parentPath​(java.lang.String name)