Class PutMappingRequest

java.lang.Object
org.opensearch.client.TimedRequest
org.opensearch.client.indices.PutMappingRequest
All Implemented Interfaces:
org.opensearch.action.IndicesRequest, Validatable, org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentObject

public class PutMappingRequest extends TimedRequest implements org.opensearch.action.IndicesRequest, org.opensearch.core.xcontent.ToXContentObject
Put a mapping definition into one or more indices. If an index already contains mappings, the new mappings will be merged with the existing one. If there are elements that cannot be merged, the request will be rejected.
Opensearch.api:
  • Constructor Details

    • PutMappingRequest

      public PutMappingRequest(String... indices)
      Constructs a new put mapping request against one or more indices. If no indices are provided then it will be executed against all indices.
  • Method Details

    • indices

      public String[] indices()
      The indices into which the mappings will be put.
      Specified by:
      indices in interface org.opensearch.action.IndicesRequest
    • indicesOptions

      public org.opensearch.action.support.IndicesOptions indicesOptions()
      Specified by:
      indicesOptions in interface org.opensearch.action.IndicesRequest
    • indicesOptions

      public PutMappingRequest indicesOptions(org.opensearch.action.support.IndicesOptions indicesOptions)
    • source

      public org.opensearch.core.common.bytes.BytesReference source()
      The mapping source definition.
    • mediaType

      public org.opensearch.core.xcontent.MediaType mediaType()
      The MediaType of the mapping source.
    • source

      public PutMappingRequest source(Map<String,?> mappingSource)
      The mapping source definition.

      Note that the definition should *not* be nested under a type name.

    • source

      public PutMappingRequest source(String mappingSource, org.opensearch.core.xcontent.MediaType mediaType)
      The mapping source definition.

      Note that the definition should *not* be nested under a type name.

    • source

      public PutMappingRequest source(org.opensearch.core.xcontent.XContentBuilder builder)
      The mapping source definition.

      Note that the definition should *not* be nested under a type name.

    • source

      public PutMappingRequest source(org.opensearch.core.common.bytes.BytesReference source, org.opensearch.core.xcontent.MediaType mediaType)
      The mapping source definition.

      Note that the definition should *not* be nested under a type name.

    • 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