public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> implements IndicesRequest.Replaceable
Requests.putMappingRequest(String...).
If the mappings already exists, the new mappings will be merged with the new one. If there are elements that can't be merged are detected, the request will be rejected.
TransportRequest.EmptyIndicesRequest.ReplaceableDEFAULT_ACK_TIMEOUT, timeoutDEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeoutheaders| Constructor and Description |
|---|
PutMappingRequest() |
PutMappingRequest(String... indices)
Constructs a new put mapping request against one or more indices.
|
| Modifier and Type | Method and Description |
|---|---|
static XContentBuilder |
buildFromSimplifiedDef(String type,
Object... source) |
String[] |
indices()
The indices the mappings will be put.
|
PutMappingRequest |
indices(String[] indices)
Sets the indices this put mapping operation will execute on.
|
IndicesOptions |
indicesOptions()
Returns the indices options used to resolve indices.
|
PutMappingRequest |
indicesOptions(IndicesOptions indicesOptions) |
void |
readFrom(StreamInput in) |
String |
source()
The mapping source definition.
|
PutMappingRequest |
source(Map mappingSource)
The mapping source definition.
|
PutMappingRequest |
source(Object... source)
A specialized simplified mapping source method, takes the form of simple properties definition:
("field1", "type=string,store=true").
|
PutMappingRequest |
source(String mappingSource)
The mapping source definition.
|
PutMappingRequest |
source(XContentBuilder mappingBuilder)
The mapping source definition.
|
String |
type()
The mapping type.
|
PutMappingRequest |
type(String type)
The type of the mappings.
|
boolean |
updateAllTypes()
True if all fields that span multiple types should be updated, false otherwise
|
PutMappingRequest |
updateAllTypes(boolean updateAllTypes)
See
updateAllTypes() |
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out) |
ackTimeout, readTimeout, timeout, timeout, timeout, writeTimeoutmasterNodeTimeout, masterNodeTimeout, masterNodeTimeoutcreateTask, createTask, setParentTaskgetDescriptionremoteAddress, remoteAddresscontextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmasterNodeTimeoutpublic PutMappingRequest()
public PutMappingRequest(String... indices)
public ActionRequestValidationException validate()
validate in class ActionRequest<PutMappingRequest>public PutMappingRequest indices(String[] indices)
indices in interface IndicesRequest.Replaceablepublic String[] indices()
indices in interface IndicesRequestpublic IndicesOptions indicesOptions()
IndicesRequestindicesOptions in interface IndicesRequestpublic PutMappingRequest indicesOptions(IndicesOptions indicesOptions)
public String type()
public PutMappingRequest type(String type)
public String source()
public PutMappingRequest source(Object... source)
public static XContentBuilder buildFromSimplifiedDef(String type, Object... source)
public PutMappingRequest source(XContentBuilder mappingBuilder)
public PutMappingRequest source(Map mappingSource)
public PutMappingRequest source(String mappingSource)
public boolean updateAllTypes()
public PutMappingRequest updateAllTypes(boolean updateAllTypes)
updateAllTypes()public void readFrom(StreamInput in) throws IOException
readFrom in interface StreamablereadFrom in class MasterNodeRequest<PutMappingRequest>IOExceptionpublic void writeTo(StreamOutput out) throws IOException
writeTo in interface StreamablewriteTo in class MasterNodeRequest<PutMappingRequest>IOExceptionCopyright © 2009–2017. All rights reserved.