Class Mapping

java.lang.Object
org.opensearch.index.mapper.Mapping
All Implemented Interfaces:
org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentFragment

@PublicApi(since="1.0.0") public final class Mapping extends Object implements org.opensearch.core.xcontent.ToXContentFragment
Wrapper around everything that defines a mapping, without references to utility classes like MapperService, ...
Opensearch.api:
  • Constructor Details

  • Method Details

    • root

      public RootObjectMapper root()
      Return the root object mapper.
    • validate

      public void validate(MappingLookup mappers)
    • mappingUpdate

      public Mapping mappingUpdate(Mapper rootObjectMapper)
      Generate a mapping update for the given root object mapper.
    • metadataMapper

      public <T extends MetadataFieldMapper> T metadataMapper(Class<T> clazz)
      Get the root mapper with the given class.
    • merge

      public Mapping merge(Mapping mergeWith, MapperService.MergeReason reason)
      Merges a new mapping into the existing one.
      Parameters:
      mergeWith - the new mapping to merge into this one.
      reason - the reason this merge was initiated.
      Returns:
      the resulting merged mapping.
    • getMetadataMapper

      public MetadataFieldMapper getMetadataMapper(String mapperName)
    • toXContent

      public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.opensearch.core.xcontent.ToXContent
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object