Class PutMappingRequest

java.lang.Object
org.opensearch.client.opensearch._types.RequestBase
org.opensearch.client.opensearch.indices.PutMappingRequest
All Implemented Interfaces:
JsonpSerializable, PlainJsonSerializable, ToCopyableBuilder<PutMappingRequest.Builder,PutMappingRequest>

@JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") public final class PutMappingRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder<PutMappingRequest.Builder,PutMappingRequest>
Updates the index mappings.
  • Field Details

  • Method Details

    • of

    • allowNoIndices

      @Nullable public final Boolean allowNoIndices()
      If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes.

      API name: allow_no_indices

    • clusterManagerTimeout

      @Nullable public final Time clusterManagerTimeout()
      Operation timeout for connection to cluster-manager node.

      API name: cluster_manager_timeout

    • dateDetection

      @Nullable public final Boolean dateDetection()
      Controls whether dynamic date detection is enabled.

      API name: date_detection

    • dynamic

      @Nullable public final DynamicMapping dynamic()
      API name: dynamic
    • dynamicDateFormats

      @Nonnull public final List<String> dynamicDateFormats()
      If date detection is enabled then new string fields are checked against dynamic_date_formats and if the value matches then a new date field is added instead of string.

      API name: dynamic_date_formats

    • dynamicTemplates

      @Nonnull public final List<Map<String,DynamicTemplate>> dynamicTemplates()
      Specify dynamic templates for the mapping.

      API name: dynamic_templates

    • expandWildcards

      @Nonnull public final List<ExpandWildcard> expandWildcards()
      Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

      API name: expand_wildcards

    • fieldNames

      @Nullable public final FieldNamesField fieldNames()
      API name: _field_names
    • ignoreUnavailable

      @Nullable public final Boolean ignoreUnavailable()
      If false, the request returns an error if it targets a missing or closed index.

      API name: ignore_unavailable

    • index

      @Nonnull public final List<String> index()
      Required - A comma-separated list of index names the mapping should be added to (supports wildcards); use _all or omit to add the mapping on all indexes.

      API name: index

    • masterTimeout

      @Deprecated @Nullable public final Time masterTimeout()
      Deprecated.
      Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.

      API name: master_timeout

    • meta

      @Nonnull public final Map<String,JsonData> meta()
      API name: _meta
    • numericDetection

      @Nullable public final Boolean numericDetection()
      Automatically map strings into numeric data types for all fields.

      API name: numeric_detection

    • properties

      @Nonnull public final Map<String,Property> properties()

      Mapping for a field. For new fields, this mapping can include:

      • Field name
      • Field data type
      • Mapping parameters

      API name: properties

    • routing

      @Nullable public final RoutingField routing()
      API name: _routing
    • source

      @Nullable public final SourceField source()
      API name: _source
    • timeout

      @Nullable public final Time timeout()
      Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

      API name: timeout

    • writeIndexOnly

      @Nullable public final Boolean writeIndexOnly()
      If true, the mappings are applied only to the current write index for the target.

      API name: write_index_only

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toBuilder

      @Nonnull public PutMappingRequest.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Create a new builder ToCopyableBuilder that is initialised with the current state of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<PutMappingRequest.Builder,PutMappingRequest>
      Returns:
      a new builder instance.
    • builder

      @Nonnull public static PutMappingRequest.Builder builder()
    • setupPutMappingRequestDeserializer

      protected static void setupPutMappingRequestDeserializer(ObjectDeserializer<PutMappingRequest.Builder> op)
    • applyQueryParameters

      protected void applyQueryParameters(@Nonnull Map<String,String> params)
      Overrides:
      applyQueryParameters in class RequestBase
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object