Class PutMappingRequest.Builder
- All Implemented Interfaces:
WithJson<PutMappingRequest.Builder>
,ObjectBuilder<PutMappingRequest>
- Enclosing class:
- PutMappingRequest
PutMappingRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowNoIndices
(Boolean value) Iffalse
, the request returns an error if any wildcard expression, index alias, or_all
value targets only missing or closed indices.build()
Builds aPutMappingRequest
.dateDetection
(Boolean value) Controls whether dynamic date detection is enabled.dynamic
(DynamicMapping value) Controls whether new fields are added dynamically.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.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.dynamicTemplates
(List<Map<String, DynamicTemplate>> list) Specify dynamic templates for the mapping.dynamicTemplates
(Map<String, DynamicTemplate> value, Map<String, DynamicTemplate>... values) Specify dynamic templates for the mapping.expandWildcards
(ExpandWildcard value, ExpandWildcard... values) Type of index that wildcard patterns can match.expandWildcards
(List<ExpandWildcard> list) Type of index that wildcard patterns can match.fieldNames
(FieldNamesField value) Control whether field names are enabled for the index.Control whether field names are enabled for the index.ignoreUnavailable
(Boolean value) Iffalse
, the request returns an error if it targets a missing or closed 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 indices.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.masterTimeout
(Time value) Period to wait for a connection to the master node.Period to wait for a connection to the master node.A mapping type can have custom meta data associated with it.A mapping type can have custom meta data associated with it.numericDetection
(Boolean value) Automatically map strings into numeric data types for all fields.properties
(String key, Property value) Mapping for a field.properties
(String key, Function<Property.Builder, ObjectBuilder<Property>> fn) Mapping for a field.properties
(Map<String, Property> map) Mapping for a field.routing
(RoutingField value) Enable making a routing value required on indexed documents.Enable making a routing value required on indexed documents.runtime
(String key, RuntimeField value) Mapping of runtime fields for the index.Mapping of runtime fields for the index.runtime
(Map<String, RuntimeField> map) Mapping of runtime fields for the index.protected PutMappingRequest.Builder
self()
source
(SourceField value) Control whether the _source field is enabled on the index.Control whether the _source field is enabled on the index.Period to wait for a response.Period to wait for a response.writeIndexOnly
(Boolean value) Iftrue
, the mappings are applied only to the current write index for the target.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
fieldNames
Control whether field names are enabled for the index.API name:
_field_names
-
fieldNames
public final PutMappingRequest.Builder fieldNames(Function<FieldNamesField.Builder, ObjectBuilder<FieldNamesField>> fn) Control whether field names are enabled for the index.API name:
_field_names
-
meta
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
tometa
. -
meta
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
Enable making a routing value required on indexed documents.API name:
_routing
-
routing
public final PutMappingRequest.Builder routing(Function<RoutingField.Builder, ObjectBuilder<RoutingField>> fn) Enable making a routing value required on indexed documents.API name:
_routing
-
source
Control whether the _source field is enabled on the index.API name:
_source
-
source
public final PutMappingRequest.Builder source(Function<SourceField.Builder, ObjectBuilder<SourceField>> fn) Control whether the _source field is enabled on the index.API name:
_source
-
allowNoIndices
Iffalse
, 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
Controls whether dynamic date detection is enabled.API name:
date_detection
-
dynamic
Controls whether new fields are added dynamically.API name:
dynamic
-
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
Adds all elements of
list
todynamicDateFormats
. -
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
Adds one or more values to
dynamicDateFormats
. -
dynamicTemplates
Specify dynamic templates for the mapping.API name:
dynamic_templates
Adds all elements of
list
todynamicTemplates
. -
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
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 asopen,hidden
. Valid values are:all
,open
,closed
,hidden
,none
.API name:
expand_wildcards
Adds all elements of
list
toexpandWildcards
. -
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 asopen,hidden
. Valid values are:all
,open
,closed
,hidden
,none
.API name:
expand_wildcards
Adds one or more values to
expandWildcards
. -
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 indices.API name:
index
Adds all elements of
list
toindex
. -
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 indices.API name:
index
Adds one or more values to
index
. -
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
-
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
Automatically map strings into numeric data types for all fields.API name:
numeric_detection
-
properties
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
toproperties
. -
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
. -
properties
public final PutMappingRequest.Builder properties(String key, 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
Mapping of runtime fields for the index.API name:
runtime
Adds all entries of
map
toruntime
. -
runtime
Mapping of runtime fields for the index.API name:
runtime
Adds an entry to
runtime
. -
runtime
public final PutMappingRequest.Builder runtime(String key, 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
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
Iftrue
, the mappings are applied only to the current write index for the target.API name:
write_index_only
-
self
- Specified by:
self
in classRequestBase.AbstractBuilder<PutMappingRequest.Builder>
-
build
Builds aPutMappingRequest
.- Specified by:
build
in interfaceObjectBuilder<PutMappingRequest>
- Throws:
NullPointerException
- if some of the required fields are null.
-