Class MapperBuilderContext

java.lang.Object
org.elasticsearch.index.mapper.MapperBuilderContext

public class MapperBuilderContext extends Object
Holds context for building Mapper objects from their Builders
  • Method Details

    • root

      public static MapperBuilderContext root(boolean isSourceSynthetic, boolean isDataStream)
      The root context, to be used when building a tree of mappers
    • root

      public static MapperBuilderContext root(boolean isSourceSynthetic, boolean isDataStream, MapperService.MergeReason mergeReason)
    • createChildContext

      public MapperBuilderContext createChildContext(String name, @Nullable ObjectMapper.Dynamic dynamic)
      Creates a new MapperBuilderContext that is a child of this context
      Parameters:
      name - the name of the child context
      dynamic - strategy for handling dynamic mappings in this context
      Returns:
      a new MapperBuilderContext with this context as its parent
    • createChildContext

      public MapperBuilderContext createChildContext(String name, boolean parentObjectContainsDimensions, @Nullable ObjectMapper.Dynamic dynamic)
      Creates a new MapperBuilderContext that is a child of this context
      Parameters:
      name - the name of the child context
      dynamic - strategy for handling dynamic mappings in this context
      parentObjectContainsDimensions - whether the parent object contains dimensions
      Returns:
      a new MapperBuilderContext with this context as its parent
    • getDynamic

      protected ObjectMapper.Dynamic getDynamic(@Nullable ObjectMapper.Dynamic dynamic)
    • buildFullName

      public String buildFullName(String name)
      Builds the full name of the field, taking into account parent objects
    • isSourceSynthetic

      public boolean isSourceSynthetic()
      Is the _source field being reconstructed on the fly?
    • isDataStream

      public boolean isDataStream()
      Are these mappings being built for a data stream index?
    • parentObjectContainsDimensions

      public boolean parentObjectContainsDimensions()
      Are these field mappings being built dimensions?
    • getDynamic

      public ObjectMapper.Dynamic getDynamic()
    • getMergeReason

      public MapperService.MergeReason getMergeReason()
      The merge reason to use when merging mappers while building the mapper. See also ObjectMapper.Builder.buildMappers(MapperBuilderContext).
    • isInNestedContext

      public boolean isInNestedContext()
      Returns true if this context is included in a nested context, either directly or any of its ancestors.