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
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Fields inherited from interface org.elasticsearch.client.Validatable
EMPTY
-
-
Constructor Summary
Constructors Constructor Description PutMappingRequest(String... indices)Constructs a new put mapping request against one or more indices.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]indices()The indices into which the mappings will be put.IndicesOptionsindicesOptions()Returns the indices options used to resolve indices.PutMappingRequestindicesOptions(IndicesOptions indicesOptions)BytesReferencesource()The mapping source definition.PutMappingRequestsource(String mappingSource, XContentType xContentType)The mapping source definition.PutMappingRequestsource(Map<String,?> mappingSource)The mapping source definition.PutMappingRequestsource(BytesReference source, XContentType xContentType)The mapping source definition.PutMappingRequestsource(XContentBuilder builder)The mapping source definition.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)XContentTypexContentType()TheXContentTypeof the mapping source.-
Methods inherited from class org.elasticsearch.client.TimedRequest
masterNodeTimeout, setMasterTimeout, setTimeout, timeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Methods inherited from interface org.elasticsearch.client.Validatable
validate
-
-
-
-
Constructor Detail
-
PutMappingRequest
public PutMappingRequest(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 Detail
-
indices
public String[] indices()
The indices into which the mappings will be put.- Specified by:
indicesin interfaceIndicesRequest
-
indicesOptions
public IndicesOptions indicesOptions()
Description copied from interface:IndicesRequestReturns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.- Specified by:
indicesOptionsin interfaceIndicesRequest
-
indicesOptions
public PutMappingRequest indicesOptions(IndicesOptions indicesOptions)
-
source
public BytesReference source()
The mapping source definition.
-
xContentType
public XContentType xContentType()
TheXContentTypeof the mapping source.
-
source
public PutMappingRequest source(Map<String,?> mappingSource)
The mapping source definition. Note that the definition should *not* be nested under a type name.
-
source
public PutMappingRequest source(String mappingSource, XContentType xContentType)
The mapping source definition. Note that the definition should *not* be nested under a type name.
-
source
public PutMappingRequest source(XContentBuilder builder)
The mapping source definition. Note that the definition should *not* be nested under a type name.
-
source
public PutMappingRequest source(BytesReference source, XContentType xContentType)
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 IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
-