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.Empty
IndicesRequest.Replaceable
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
headers
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, writeTimeout
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
createTask, createTask, setParentTask
getDescription
remoteAddress, remoteAddress
contextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterNodeTimeout
public PutMappingRequest()
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 updateAllTypes()
public PutMappingRequest updateAllTypes(boolean updateAllTypes)
updateAllTypes()
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class MasterNodeRequest<PutMappingRequest>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class MasterNodeRequest<PutMappingRequest>
IOException
Copyright © 2009–2016. All rights reserved.