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 unless the ignoreConflicts(boolean)
is set. In such a case, the duplicate mappings will be rejected.
TransportRequest.EmptyIndicesRequest.ReplaceableDEFAULT_ACK_TIMEOUT, timeoutDEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeoutheaders| Constructor and Description |
|---|
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) |
boolean |
ignoreConflicts()
If there is already a mapping definition registered against the type, then it will be merged.
|
PutMappingRequest |
ignoreConflicts(boolean ignoreDuplicates)
If there is already a mapping definition registered against the type, then it will be merged.
|
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.
|
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out) |
ackTimeout, readTimeout, timeout, timeout, timeout, writeTimeoutmasterNodeTimeout, masterNodeTimeout, masterNodeTimeoutlistenerThreaded, listenerThreadedputHeader, remoteAddress, remoteAddresscontextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putInContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmasterNodeTimeoutpublic 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 ignoreConflicts()
ignoreConflicts(boolean) is set. In such a case, the duplicate mappings will be rejected.public PutMappingRequest ignoreConflicts(boolean ignoreDuplicates)
ignoreConflicts(boolean) is set. In such a case, the duplicate mappings will be rejected.public void readFrom(StreamInput in) throws IOException
readFrom in interface StreamablereadFrom in class MasterNodeOperationRequest<PutMappingRequest>IOExceptionpublic void writeTo(StreamOutput out) throws IOException
writeTo in interface StreamablewriteTo in class MasterNodeOperationRequest<PutMappingRequest>IOExceptionCopyright © 2009–2016. All rights reserved.