Class PutMappingRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.support.master.MasterNodeRequest<Request>
org.elasticsearch.action.support.master.AcknowledgedRequest<PutMappingRequest>
org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest
- All Implemented Interfaces:
- IndicesRequest,- IndicesRequest.Replaceable,- AckedRequest,- Writeable,- org.elasticsearch.common.xcontent.ToXContent,- org.elasticsearch.common.xcontent.ToXContentObject,- org.elasticsearch.core.RefCounted,- TaskAwareRequest
public class PutMappingRequest
extends AcknowledgedRequest<PutMappingRequest>
implements IndicesRequest.Replaceable, org.elasticsearch.common.xcontent.ToXContentObject
Puts mapping definition registered under a specific type into one or more indices. Best created with
 
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.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequestTransportRequest.EmptyNested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequestIndicesRequest.ReplaceableNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContentorg.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFields inherited from class org.elasticsearch.action.support.master.AcknowledgedRequestDEFAULT_ACK_TIMEOUT, timeoutFields inherited from class org.elasticsearch.action.support.master.MasterNodeRequestDEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeoutFields inherited from interface org.elasticsearch.common.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructorsConstructorDescriptionPutMappingRequest(String... indices)Constructs a new put mapping request against one or more indices.
- 
Method SummaryModifier and TypeMethodDescriptionstatic org.elasticsearch.common.xcontent.XContentBuilderbuildFromSimplifiedDef(String type, Object... source)Returns a concrete index for this mapping ornullif no concrete index is definedbooleanDetermines whether the request should be applied to data streams.String[]indices()The indices the mappings will be put.Sets the indices this put mapping operation will execute on.Returns the indices options used to resolve indices.indicesOptions(IndicesOptions indicesOptions)origin()setConcreteIndex(Index index)Sets a concrete index for this put mapping request.source()The mapping source definition.A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").The mapping source definition.The mapping source definition.source(BytesReference mappingSource, org.elasticsearch.common.xcontent.XContentType xContentType)The mapping source definition.source(org.elasticsearch.common.xcontent.XContentBuilder mappingBuilder)The mapping source definition.org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)type()The mapping type.The type of the mappings.validate()booleanwriteIndexOnly(boolean writeIndexOnly)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.AcknowledgedRequestackTimeout, timeout, timeout, timeoutMethods inherited from class org.elasticsearch.action.support.master.MasterNodeRequestmasterNodeTimeout, masterNodeTimeout, masterNodeTimeoutMethods inherited from class org.elasticsearch.action.ActionRequestgetShouldStoreResultMethods inherited from class org.elasticsearch.transport.TransportRequestgetParentTask, setParentTask, toStringMethods inherited from class org.elasticsearch.transport.TransportMessagedecRef, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.ack.AckedRequestmasterNodeTimeoutMethods inherited from interface org.elasticsearch.action.IndicesRequestallowsRemoteIndicesMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequestcreateTask, getDescription, setParentTaskMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentObjectisFragment
- 
Constructor Details- 
PutMappingRequest- Throws:
- IOException
 
- 
PutMappingRequestpublic PutMappingRequest()
- 
PutMappingRequestConstructs a new put mapping request against one or more indices. If nothing is set then it will be executed against all indices.
 
- 
- 
Method Details- 
validate- Specified by:
- validatein class- ActionRequest
 
- 
indicesSets the indices this put mapping operation will execute on.- Specified by:
- indicesin interface- IndicesRequest.Replaceable
 
- 
setConcreteIndexSets a concrete index for this put mapping request.
- 
getConcreteIndexReturns a concrete index for this mapping ornullif no concrete index is defined
- 
indicesThe indices the mappings will be put.- Specified by:
- indicesin interface- IndicesRequest
 
- 
indicesOptionsDescription copied from interface:IndicesRequestReturns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.- Specified by:
- indicesOptionsin interface- IndicesRequest
 
- 
indicesOptions
- 
includeDataStreamspublic boolean includeDataStreams()Description copied from interface:IndicesRequestDetermines whether the request should be applied to data streams. Whenfalse, none of the names or wildcard expressions inIndicesRequest.indices()should be applied to or expanded to any data streams. All layers involved in the request's fulfillment including security, name resolution, etc., should respect this flag.- Specified by:
- includeDataStreamsin interface- IndicesRequest
 
- 
typeThe mapping type.
- 
typeThe type of the mappings.
- 
sourceThe mapping source definition.
- 
sourceA specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true"). Also supports metadata mapping fields such as `_all` and `_parent` as property definition, these metadata mapping fields will automatically be put on the top level mapping object.
- 
origin
- 
origin
- 
buildFromSimplifiedDefpublic static org.elasticsearch.common.xcontent.XContentBuilder buildFromSimplifiedDef(String type, Object... source)- Parameters:
- type- the mapping type
- source- consisting of field/properties pairs (e.g. "field1", "type=string,store=true")
- Returns:
- the mappings definition
- Throws:
- IllegalArgumentException- if the number of the source arguments is not divisible by two
 
- 
sourceThe mapping source definition.
- 
sourceThe mapping source definition.
- 
sourcepublic PutMappingRequest source(String mappingSource, org.elasticsearch.common.xcontent.XContentType xContentType)The mapping source definition.
- 
sourcepublic PutMappingRequest source(BytesReference mappingSource, org.elasticsearch.common.xcontent.XContentType xContentType)The mapping source definition.
- 
writeIndexOnly
- 
writeIndexOnlypublic boolean writeIndexOnly()
- 
writeToDescription copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
- writeToin interface- Writeable
- Overrides:
- writeToin class- AcknowledgedRequest<PutMappingRequest>
- Throws:
- IOException
 
- 
toXContentpublic org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
- toXContentin interface- org.elasticsearch.common.xcontent.ToXContent
- Throws:
- IOException
 
 
-