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.Empty
IndicesRequest.Replaceable
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
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, writeTimeout
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
listenerThreaded, listenerThreaded
getHeader, getHeaders, hasHeader, putHeader, remoteAddress, remoteAddress
contextSize, copyContextFrom, getContext, getFromContext, getFromContext, hasInContext, isContextEmpty, putAllInContext, putInContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterNodeTimeout
public PutMappingRequest(String... indices)
public ActionRequestValidationException validate()
validate
in class ActionRequest<PutMappingRequest>
public PutMappingRequest indices(String[] indices)
indices
in interface IndicesRequest.Replaceable
public String[] indices()
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public 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 Streamable
readFrom
in class MasterNodeOperationRequest<PutMappingRequest>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class MasterNodeOperationRequest<PutMappingRequest>
IOException
Copyright © 2009–2015. All rights reserved.