Package org.elasticsearch.client.indices
Class PutMappingRequest
java.lang.Object
org.elasticsearch.client.TimedRequest
org.elasticsearch.client.indices.PutMappingRequest
- All Implemented Interfaces:
IndicesRequest
,Validatable
,ToXContent
,ToXContentObject
public class PutMappingRequest extends TimedRequest implements IndicesRequest, ToXContentObject
Put a mapping definition into one or more indices. If an index already contains mappings,
the new mappings will be merged with the existing one. If there are elements that cannot
be merged, the request will be rejected.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
Fields inherited from class org.elasticsearch.client.TimedRequest
DEFAULT_ACK_TIMEOUT, DEFAULT_MASTER_NODE_TIMEOUT
-
Constructor Summary
Constructors Constructor Description PutMappingRequest(java.lang.String... indices)
Constructs a new put mapping request against one or more indices. -
Method Summary
Modifier and Type Method Description java.lang.String[]
indices()
The indices into which the mappings will be put.IndicesOptions
indicesOptions()
PutMappingRequest
indicesOptions(IndicesOptions indicesOptions)
BytesReference
source()
The mapping source definition.PutMappingRequest
source(java.lang.String mappingSource, XContentType xContentType)
The mapping source definition.PutMappingRequest
source(java.util.Map<java.lang.String,?> mappingSource)
The mapping source definition.PutMappingRequest
source(BytesReference source, XContentType xContentType)
The mapping source definition.PutMappingRequest
source(XContentBuilder builder)
The mapping source definition.XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
XContentType
xContentType()
TheXContentType
of the mapping source.Methods inherited from class org.elasticsearch.client.TimedRequest
masterNodeTimeout, setMasterTimeout, setTimeout, timeout
-
Constructor Details
-
PutMappingRequest
public PutMappingRequest(java.lang.String... indices)Constructs a new put mapping request against one or more indices. If no indices are provided then it will be executed against all indices.
-
-
Method Details
-
indices
public java.lang.String[] indices()The indices into which the mappings will be put.- Specified by:
indices
in interfaceIndicesRequest
-
indicesOptions
- Specified by:
indicesOptions
in interfaceIndicesRequest
-
indicesOptions
-
source
The mapping source definition. -
xContentType
TheXContentType
of the mapping source. -
source
The mapping source definition. Note that the definition should *not* be nested under a type name. -
source
The mapping source definition. Note that the definition should *not* be nested under a type name. -
source
The mapping source definition. Note that the definition should *not* be nested under a type name. -
source
The mapping source definition. Note that the definition should *not* be nested under a type name. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-