Class PutMappingRequest.Builder
java.lang.Object
co.elastic.clients.elasticsearch.indices.PutMappingRequest.Builder
- All Implemented Interfaces:
ObjectBuilder<PutMappingRequest>
- Enclosing class:
- PutMappingRequest
public static class PutMappingRequest.Builder extends java.lang.Object implements ObjectBuilder<PutMappingRequest>
Builder for
PutMappingRequest
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description PutMappingRequest.Builder
addDynamicDateFormats(java.lang.String value)
Add a value todynamicDateFormats(List)
, creating the list if needed.PutMappingRequest.Builder
addDynamicTemplates(java.util.Map<java.lang.String,DynamicTemplate> value)
Add a value todynamicTemplates(List)
, creating the list if needed.PutMappingRequest.Builder
addExpandWildcards(ExpandWildcardOptions value)
Add a value toexpandWildcards(List)
, creating the list if needed.PutMappingRequest.Builder
addIndex(java.lang.String value)
Add a value toindex(List)
, creating the list if needed.PutMappingRequest.Builder
allowNoIndices(java.lang.Boolean value)
Whether to ignore if a wildcard indices expression resolves into no concrete indices.PutMappingRequest
build()
Builds aPutMappingRequest
.PutMappingRequest.Builder
dateDetection(java.lang.Boolean value)
Controls whether dynamic date detection is enabled.PutMappingRequest.Builder
dynamic(jakarta.json.JsonValue value)
Controls whether new fields are added dynamically.PutMappingRequest.Builder
dynamicDateFormats(java.lang.String... value)
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.PutMappingRequest.Builder
dynamicDateFormats(java.util.List<java.lang.String> value)
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.PutMappingRequest.Builder
dynamicTemplates(java.util.List<java.util.Map<java.lang.String,DynamicTemplate>> value)
Specify dynamic templates for the mapping.PutMappingRequest.Builder
dynamicTemplates(java.util.Map<java.lang.String,DynamicTemplate>... value)
Specify dynamic templates for the mapping.PutMappingRequest.Builder
expandWildcards(ExpandWildcardOptions... value)
Whether to expand wildcard expression to concrete indices that are open, closed or both.PutMappingRequest.Builder
expandWildcards(java.util.List<ExpandWildcardOptions> value)
Whether to expand wildcard expression to concrete indices that are open, closed or both.PutMappingRequest.Builder
fieldNames(FieldNamesField value)
Control whether field names are enabled for the index.PutMappingRequest.Builder
fieldNames(java.util.function.Function<FieldNamesField.Builder,ObjectBuilder<FieldNamesField>> fn)
Control whether field names are enabled for the index.PutMappingRequest.Builder
ignoreUnavailable(java.lang.Boolean value)
Whether specified concrete indices should be ignored when unavailable (missing or closed)PutMappingRequest.Builder
includeTypeName(java.lang.Boolean value)
Whether a type should be expected in the body of the mappings.PutMappingRequest.Builder
index(java.lang.String... value)
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.PutMappingRequest.Builder
index(java.util.List<java.lang.String> value)
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.PutMappingRequest.Builder
masterTimeout(java.lang.String value)
Specify timeout for connection to masterPutMappingRequest.Builder
meta(java.util.Map<java.lang.String,JsonData> value)
A mapping type can have custom meta data associated with it.PutMappingRequest.Builder
numericDetection(java.lang.Boolean value)
Automatically map strings into numeric data types for all fields.PutMappingRequest.Builder
properties(java.lang.String key, java.util.function.Function<Property.Builder,ObjectBuilder<Property>> fn)
Setproperties(Map)
to a singleton map.PutMappingRequest.Builder
properties(java.util.Map<java.lang.String,Property> value)
Mapping for a field.PutMappingRequest.Builder
putMeta(java.lang.String key, JsonData value)
Add a key/value tometa(Map)
, creating the map if needed.PutMappingRequest.Builder
putProperties(java.lang.String key, Property value)
Add a key/value toproperties(Map)
, creating the map if needed.PutMappingRequest.Builder
putProperties(java.lang.String key, java.util.function.Function<Property.Builder,ObjectBuilder<Property>> fn)
Add a key/value toproperties(Map)
, creating the map if needed.PutMappingRequest.Builder
putRuntime(java.lang.String key, RuntimeField value)
Add a key/value toruntime(Map)
, creating the map if needed.PutMappingRequest.Builder
putRuntime(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)
Add a key/value toruntime(Map)
, creating the map if needed.PutMappingRequest.Builder
routing(RoutingField value)
Enable making a routing value required on indexed documents.PutMappingRequest.Builder
routing(java.util.function.Function<RoutingField.Builder,ObjectBuilder<RoutingField>> fn)
Enable making a routing value required on indexed documents.PutMappingRequest.Builder
runtime(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)
Setruntime(Map)
to a singleton map.PutMappingRequest.Builder
runtime(java.util.Map<java.lang.String,RuntimeField> value)
Mapping of runtime fields for the index.PutMappingRequest.Builder
source(SourceField value)
Control whether the _source field is enabled on the index.PutMappingRequest.Builder
source(java.util.function.Function<SourceField.Builder,ObjectBuilder<SourceField>> fn)
Control whether the _source field is enabled on the index.PutMappingRequest.Builder
timeout(java.lang.String value)
Explicit operation timeoutPutMappingRequest.Builder
type(java.lang.String value)
The name of the document typePutMappingRequest.Builder
writeIndexOnly(java.lang.Boolean value)
When true, applies mappings only to the write index of an alias or data streamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
-
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
-
addIndex
Add a value toindex(List)
, creating the list if needed. -
type
The name of the document typeAPI name:
type
-
allowNoIndices
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
-
expandWildcards
public PutMappingRequest.Builder expandWildcards(@Nullable java.util.List<ExpandWildcardOptions> value)Whether to expand wildcard expression to concrete indices that are open, closed or both.API name:
expand_wildcards
-
expandWildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both.API name:
expand_wildcards
-
addExpandWildcards
Add a value toexpandWildcards(List)
, creating the list if needed. -
includeTypeName
Whether a type should be expected in the body of the mappings.API name:
include_type_name
-
masterTimeout
Specify timeout for connection to masterAPI name:
master_timeout
-
timeout
Explicit operation timeoutAPI name:
timeout
-
writeIndexOnly
When true, applies mappings only to the write index of an alias or data streamAPI name:
write_index_only
-
dateDetection
Controls whether dynamic date detection is enabled.API name:
date_detection
-
dynamic
Controls whether new fields are added dynamically.API name:
dynamic
-
dynamicDateFormats
public PutMappingRequest.Builder dynamicDateFormats(@Nullable java.util.List<java.lang.String> value)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
-
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
-
addDynamicDateFormats
Add a value todynamicDateFormats(List)
, creating the list if needed. -
dynamicTemplates
public PutMappingRequest.Builder dynamicTemplates(@Nullable java.util.List<java.util.Map<java.lang.String,DynamicTemplate>> value)Specify dynamic templates for the mapping.API name:
dynamic_templates
-
dynamicTemplates
public PutMappingRequest.Builder dynamicTemplates(java.util.Map<java.lang.String,DynamicTemplate>... value)Specify dynamic templates for the mapping.API name:
dynamic_templates
-
addDynamicTemplates
public PutMappingRequest.Builder addDynamicTemplates(java.util.Map<java.lang.String,DynamicTemplate> value)Add a value todynamicTemplates(List)
, creating the list if needed. -
fieldNames
Control whether field names are enabled for the index.API name:
_field_names
-
fieldNames
public 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
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
-
putMeta
Add a key/value tometa(Map)
, creating the map if needed. -
numericDetection
Automatically map strings into numeric data types for all fields.API name:
numeric_detection
-
properties
public PutMappingRequest.Builder properties(@Nullable java.util.Map<java.lang.String,Property> value)Mapping for a field. For new fields, this mapping can include:- Field name
- Field data type
- Mapping parameters
API name:
properties
-
putProperties
Add a key/value toproperties(Map)
, creating the map if needed. -
properties
public PutMappingRequest.Builder properties(java.lang.String key, java.util.function.Function<Property.Builder,ObjectBuilder<Property>> fn)Setproperties(Map)
to a singleton map. -
putProperties
public PutMappingRequest.Builder putProperties(java.lang.String key, java.util.function.Function<Property.Builder,ObjectBuilder<Property>> fn)Add a key/value toproperties(Map)
, creating the map if needed. -
routing
Enable making a routing value required on indexed documents.API name:
_routing
-
routing
public 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
Control whether the _source field is enabled on the index.API name:
_source
-
source
public 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
-
runtime
public PutMappingRequest.Builder runtime(@Nullable java.util.Map<java.lang.String,RuntimeField> value)Mapping of runtime fields for the index.API name:
runtime
-
putRuntime
Add a key/value toruntime(Map)
, creating the map if needed. -
runtime
public PutMappingRequest.Builder runtime(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)Setruntime(Map)
to a singleton map. -
putRuntime
public PutMappingRequest.Builder putRuntime(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)Add a key/value toruntime(Map)
, creating the map if needed. -
build
Builds aPutMappingRequest
.- Specified by:
build
in interfaceObjectBuilder<PutMappingRequest>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-