Class PutMappingRequest.Builder

java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.indices.PutMappingRequest.Builder
All Implemented Interfaces:
ObjectBuilder<PutMappingRequest>
Enclosing class:
PutMappingRequest

public static class PutMappingRequest.Builder
extends ObjectBuilderBase
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

      public final PutMappingRequest.Builder fieldNames​(java.util.function.Function<FieldNamesField.Builder,​ObjectBuilder<FieldNamesField>> fn)
      Control whether field names are enabled for the index.

      API name: _field_names

    • meta

      public final PutMappingRequest.Builder meta​(java.util.Map<java.lang.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​(java.lang.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

      public final PutMappingRequest.Builder routing​(java.util.function.Function<RoutingField.Builder,​ObjectBuilder<RoutingField>> fn)
      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

      public final PutMappingRequest.Builder source​(java.util.function.Function<SourceField.Builder,​ObjectBuilder<SourceField>> fn)
      Control whether the _source field is enabled on the index.

      API name: _source

    • allowNoIndices

      public final PutMappingRequest.Builder allowNoIndices​(@Nullable java.lang.Boolean value)
      Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

      API name: allow_no_indices

    • dateDetection

      public final PutMappingRequest.Builder dateDetection​(@Nullable java.lang.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​(java.util.List<java.lang.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​(java.lang.String value, java.lang.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​(java.util.List<java.util.Map<java.lang.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​(java.util.Map<java.lang.String,​DynamicTemplate> value, java.util.Map<java.lang.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​(java.util.List<ExpandWildcard> list)
      Whether to expand wildcard expression to concrete indices that are open, closed or both.

      API name: expand_wildcards

      Adds all elements of list to expandWildcards.

    • expandWildcards

      public final PutMappingRequest.Builder expandWildcards​(ExpandWildcard value, ExpandWildcard... values)
      Whether to expand wildcard expression to concrete indices that are open, closed or both.

      API name: expand_wildcards

      Adds one or more values to expandWildcards.

    • ignoreUnavailable

      public final PutMappingRequest.Builder ignoreUnavailable​(@Nullable java.lang.Boolean value)
      Whether specified concrete indices should be ignored when unavailable (missing or closed)

      API name: ignore_unavailable

    • includeTypeName

      public final PutMappingRequest.Builder includeTypeName​(@Nullable java.lang.Boolean value)
      Whether a type should be expected in the body of the mappings.

      API name: include_type_name

    • index

      public final PutMappingRequest.Builder index​(java.util.List<java.lang.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​(java.lang.String value, java.lang.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)
      Specify timeout for connection to master

      API name: master_timeout

    • masterTimeout

      public final PutMappingRequest.Builder masterTimeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Specify timeout for connection to master

      API name: master_timeout

    • numericDetection

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

      API name: numeric_detection

    • properties

      public final PutMappingRequest.Builder properties​(java.util.Map<java.lang.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​(java.lang.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

      public final PutMappingRequest.Builder properties​(java.lang.String key, java.util.function.Function<Property.Builder,​ObjectBuilder<Property>> fn)
      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​(java.util.Map<java.lang.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​(java.lang.String key, RuntimeField value)
      Mapping of runtime fields for the index.

      API name: runtime

      Adds an entry to runtime.

    • runtime

      public final PutMappingRequest.Builder runtime​(java.lang.String key, java.util.function.Function<RuntimeField.Builder,​ObjectBuilder<RuntimeField>> fn)
      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)
      Explicit operation timeout

      API name: timeout

    • timeout

      public final PutMappingRequest.Builder timeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Explicit operation timeout

      API name: timeout

    • type

      public final PutMappingRequest.Builder type​(@Nullable java.lang.String value)
      The name of the document type

      API name: type

    • writeIndexOnly

      public final PutMappingRequest.Builder writeIndexOnly​(@Nullable java.lang.Boolean value)
      When true, applies mappings only to the write index of an alias or data stream

      API name: write_index_only

    • build

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