IndicesRequest
, IndicesRequest.Replaceable
, AckedRequest
, Streamable
, Writeable
, ToXContent
, ToXContentObject
, TaskAwareRequest
public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> implements IndicesRequest.Replaceable, ToXContentObject
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.
IndicesRequest.Replaceable
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
TransportRequest.Empty
Writeable.Reader<V>, Writeable.Writer<V>
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
EMPTY_PARAMS
Constructor | Description |
---|---|
PutMappingRequest() |
|
PutMappingRequest(java.lang.String... indices) |
Constructs a new put mapping request against one or more indices.
|
Modifier and Type | Method | 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(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(java.util.Map mappingSource) |
The mapping source definition.
|
PutMappingRequest |
source(BytesReference mappingSource,
XContentType xContentType) |
The mapping source definition.
|
PutMappingRequest |
source(XContentBuilder mappingBuilder) |
The mapping source definition.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
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) |
Deprecated.
useless with 6.x indices which may only have one type
|
ActionRequestValidationException |
validate() |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
masterNodeTimeout
ackTimeout, timeout, timeout, timeout
getShouldStoreResult
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTask, getDescription, setParentTask
isFragment
remoteAddress, remoteAddress
getParentTask, 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")java.lang.IllegalArgumentException
- if the number of the source arguments is not divisible by twopublic 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()
@Deprecated public PutMappingRequest updateAllTypes(boolean updateAllTypes)
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class AcknowledgedRequest<PutMappingRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in interface Writeable
writeTo
in class AcknowledgedRequest<PutMappingRequest>
java.io.IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException