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
Constructor and Description |
---|
PutMappingRequest() |
PutMappingRequest(java.lang.String... indices)
Constructs a new put mapping request against one or more indices.
|
Modifier and Type | Method and Description |
---|---|
static XContentBuilder |
buildFromSimplifiedDef(java.lang.String type,
java.lang.Object... source) |
Index |
getConcreteIndex()
Returns a concrete index for this mapping or
null if no concrete index is defined |
java.lang.String[] |
indices()
The indices the mappings will be put.
|
PutMappingRequest |
indices(java.lang.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)
Set this object's fields from a StreamInput.
|
PutMappingRequest |
setConcreteIndex(Index index)
Sets a concrete index for this put mapping request.
|
java.lang.String |
source()
The mapping source definition.
|
PutMappingRequest |
source(BytesReference mappingSource,
XContentType xContentType)
The mapping source definition.
|
PutMappingRequest |
source(java.util.Map mappingSource)
The mapping source definition.
|
PutMappingRequest |
source(java.lang.Object... source)
A specialized simplified mapping source method, takes the form of simple properties definition:
("field1", "type=string,store=true").
|
PutMappingRequest |
source(java.lang.String mappingSource,
XContentType xContentType)
The mapping source definition.
|
PutMappingRequest |
source(XContentBuilder mappingBuilder)
The mapping source definition.
|
java.lang.String |
type()
The mapping type.
|
PutMappingRequest |
type(java.lang.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)
Write this object's fields to a StreamOutput.
|
ackTimeout, readTimeout, timeout, timeout, timeout, writeTimeout
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
getShouldStoreResult
getParentTask, setParentTask
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterNodeTimeout
createTask, getDescription, setParentTask
public PutMappingRequest()
public PutMappingRequest(java.lang.String... indices)
public ActionRequestValidationException validate()
validate
in class ActionRequest
public PutMappingRequest indices(java.lang.String... indices)
indices
in interface IndicesRequest.Replaceable
public PutMappingRequest setConcreteIndex(Index index)
public Index getConcreteIndex()
null
if no concrete index is definedpublic java.lang.String[] indices()
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public PutMappingRequest indicesOptions(IndicesOptions indicesOptions)
public java.lang.String type()
public PutMappingRequest type(java.lang.String type)
public java.lang.String source()
public PutMappingRequest source(java.lang.Object... source)
public static XContentBuilder buildFromSimplifiedDef(java.lang.String type, java.lang.Object... source)
type
- the mapping typesource
- consisting of field/properties pairs (e.g. "field1",
"type=string,store=true"). If the number of arguments is not
divisible by two an IllegalArgumentException
is thrownpublic PutMappingRequest source(XContentBuilder mappingBuilder)
public PutMappingRequest source(java.util.Map mappingSource)
public PutMappingRequest source(java.lang.String mappingSource, XContentType xContentType)
public PutMappingRequest source(BytesReference mappingSource, XContentType xContentType)
public boolean updateAllTypes()
public PutMappingRequest updateAllTypes(boolean updateAllTypes)
updateAllTypes()
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class MasterNodeRequest<PutMappingRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class MasterNodeRequest<PutMappingRequest>
java.io.IOException