Class PutMappingRequest.Builder

All Implemented Interfaces:
WithJson<PutMappingRequest.Builder>, ObjectBuilder<PutMappingRequest>
Enclosing class:
PutMappingRequest

public static class PutMappingRequest.Builder extends RequestBase.AbstractBuilder<PutMappingRequest.Builder> implements ObjectBuilder<PutMappingRequest>
Builder for PutMappingRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • fieldNames

      public final PutMappingRequest.Builder fieldNames(@Nullable FieldNamesField value)
      Control whether field names are enabled for the index.

      API name: _field_names

    • fieldNames

      Control whether field names are enabled for the index.

      API name: _field_names

    • meta

      public final PutMappingRequest.Builder meta(Map<String,JsonData> map)
      A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata.

      API name: _meta

      Adds all entries of map to meta.

    • meta

      public final PutMappingRequest.Builder meta(String key, JsonData value)
      A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata.

      API name: _meta

      Adds an entry to meta.

    • routing

      public final PutMappingRequest.Builder routing(@Nullable RoutingField value)
      Enable making a routing value required on indexed documents.

      API name: _routing

    • routing

      Enable making a routing value required on indexed documents.

      API name: _routing

    • source

      public final PutMappingRequest.Builder source(@Nullable SourceField value)
      Control whether the _source field is enabled on the index.

      API name: _source

    • source

      Control whether the _source field is enabled on the index.

      API name: _source

    • allowNoIndices

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

      API name: allow_no_indices

    • dateDetection

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

      API name: date_detection

    • dynamic

      public final PutMappingRequest.Builder dynamic(@Nullable DynamicMapping value)
      Controls whether new fields are added dynamically.

      API name: dynamic

    • dynamicDateFormats

      public final PutMappingRequest.Builder dynamicDateFormats(List<String> list)
      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

      Adds all elements of list to dynamicDateFormats.

    • dynamicDateFormats

      public final PutMappingRequest.Builder dynamicDateFormats(String value, String... values)
      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

      Adds one or more values to dynamicDateFormats.

    • dynamicTemplates

      public final PutMappingRequest.Builder dynamicTemplates(List<Map<String,DynamicTemplate>> list)
      Specify dynamic templates for the mapping.

      API name: dynamic_templates

      Adds all elements of list to dynamicTemplates.

    • dynamicTemplates

      public final PutMappingRequest.Builder dynamicTemplates(Map<String,DynamicTemplate> value, Map<String,DynamicTemplate>... values)
      Specify dynamic templates for the mapping.

      API name: dynamic_templates

      Adds one or more values to dynamicTemplates.

    • expandWildcards

      public final PutMappingRequest.Builder expandWildcards(List<ExpandWildcard> list)
      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

      Adds all elements of list to expandWildcards.

    • expandWildcards

      public final PutMappingRequest.Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values)
      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

      Adds one or more values to expandWildcards.

    • ignoreUnavailable

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

      API name: ignore_unavailable

    • index

      public final PutMappingRequest.Builder index(List<String> list)
      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 indices.

      API name: index

      Adds all elements of list to index.

    • index

      public final PutMappingRequest.Builder index(String value, String... values)
      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 indices.

      API name: index

      Adds one or more values to index.

    • masterTimeout

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

      API name: master_timeout

    • masterTimeout

      Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

      API name: master_timeout

    • numericDetection

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

      API name: numeric_detection

    • properties

      public final PutMappingRequest.Builder properties(Map<String,Property> map)
      Mapping for a field. For new fields, this mapping can include:
      • Field name
      • Field data type
      • Mapping parameters

      API name: properties

      Adds all entries of map to properties.

    • properties

      public final PutMappingRequest.Builder properties(String key, Property value)
      Mapping for a field. For new fields, this mapping can include:
      • Field name
      • Field data type
      • Mapping parameters

      API name: properties

      Adds an entry to properties.

    • properties

      Mapping for a field. For new fields, this mapping can include:
      • Field name
      • Field data type
      • Mapping parameters

      API name: properties

      Adds an entry to properties using a builder lambda.

    • runtime

      public final PutMappingRequest.Builder runtime(Map<String,RuntimeField> map)
      Mapping of runtime fields for the index.

      API name: runtime

      Adds all entries of map to runtime.

    • runtime

      public final PutMappingRequest.Builder runtime(String key, RuntimeField value)
      Mapping of runtime fields for the index.

      API name: runtime

      Adds an entry to runtime.

    • runtime

      Mapping of runtime fields for the index.

      API name: runtime

      Adds an entry to runtime using a builder lambda.

    • timeout

      public final PutMappingRequest.Builder timeout(@Nullable Time value)
      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

    • 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

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

      API name: write_index_only

    • self

      protected PutMappingRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<PutMappingRequest.Builder>
    • build

      public PutMappingRequest build()
      Specified by:
      build in interface ObjectBuilder<PutMappingRequest>
      Throws:
      NullPointerException - if some of the required fields are null.