IndicesRequest, IndicesRequest.Replaceable, AckedRequest, Streamable, Writeable, ToXContent, ToXContentObject, TaskAwareRequestpublic 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.ReplaceableToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsTransportRequest.EmptyWriteable.Reader<V>, Writeable.Writer<V>DEFAULT_ACK_TIMEOUT, timeoutDEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeoutEMPTY_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.
|
masterNodeTimeoutackTimeout, timeout, timeout, timeoutgetShouldStoreResultmasterNodeTimeout, masterNodeTimeout, masterNodeTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateTask, getDescription, setParentTaskisFragmentremoteAddress, remoteAddressgetParentTask, setParentTaskpublic PutMappingRequest()
public PutMappingRequest(java.lang.String... indices)
public ActionRequestValidationException validate()
validate in class ActionRequestpublic PutMappingRequest indices(java.lang.String... indices)
indices in interface IndicesRequest.Replaceablepublic PutMappingRequest setConcreteIndex(Index index)
public Index getConcreteIndex()
null if no concrete index is definedpublic java.lang.String[] indices()
indices in interface IndicesRequestpublic IndicesOptions indicesOptions()
IndicesRequestindicesOptions in interface IndicesRequestpublic 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
StreamablereadFrom in interface StreamablereadFrom in class AcknowledgedRequest<PutMappingRequest>java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in interface WriteablewriteTo in class AcknowledgedRequest<PutMappingRequest>java.io.IOExceptionpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOException