Class PutIndexTemplateRequestBuilder
- java.lang.Object
-
- org.elasticsearch.action.ActionRequestBuilder<Request,Response>
-
- org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder<PutIndexTemplateRequest,AcknowledgedResponse,PutIndexTemplateRequestBuilder>
-
- org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder
-
public class PutIndexTemplateRequestBuilder extends MasterNodeOperationRequestBuilder<PutIndexTemplateRequest,AcknowledgedResponse,PutIndexTemplateRequestBuilder>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.ActionRequestBuilder
action, client, request
-
-
Constructor Summary
Constructors Constructor Description PutIndexTemplateRequestBuilder(ElasticsearchClient client, PutIndexTemplateAction action)PutIndexTemplateRequestBuilder(ElasticsearchClient client, PutIndexTemplateAction action, java.lang.String name)
-
Method Summary
Modifier and Type Method Description PutIndexTemplateRequestBuilderaddAlias(Alias alias)Adds an alias that will be added when the index template gets created.PutIndexTemplateRequestBuilderaddMapping(java.lang.String type, java.lang.Object... source)A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").PutIndexTemplateRequestBuilderaddMapping(java.lang.String type, java.lang.String source, XContentType xContentType)Adds mapping that will be added when the index template gets created.PutIndexTemplateRequestBuilderaddMapping(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> source)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestBuilderaddMapping(java.lang.String type, XContentBuilder source)Adds mapping that will be added when the index template gets created.PutIndexTemplateRequestBuildercause(java.lang.String cause)The cause for this index template creation.PutIndexTemplateRequestBuildersetAliases(java.lang.String source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestBuildersetAliases(java.util.Map<java.lang.String,java.lang.Object> source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestBuildersetAliases(BytesReference source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestBuildersetAliases(XContentBuilder source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestBuildersetCreate(boolean create)Set totrueto force only creation, not an update of an index template.PutIndexTemplateRequestBuildersetOrder(int order)Sets the order of this template if more than one template matches.PutIndexTemplateRequestBuildersetPatterns(java.util.List<java.lang.String> indexPatterns)Sets the match expression that will be used to match on indices created.PutIndexTemplateRequestBuildersetSettings(java.lang.String source, XContentType xContentType)The settings to crete the index template with (either json or yaml format)PutIndexTemplateRequestBuildersetSettings(java.util.Map<java.lang.String,java.lang.Object> source)The settings to crete the index template with (either json or yaml format)PutIndexTemplateRequestBuildersetSettings(Settings settings)The settings to created the index template with.PutIndexTemplateRequestBuildersetSettings(Settings.Builder settings)The settings to created the index template with.PutIndexTemplateRequestBuildersetSource(byte[] templateSource, int offset, int length, XContentType xContentType)The template source definition.PutIndexTemplateRequestBuildersetSource(byte[] templateSource, XContentType xContentType)The template source definition.PutIndexTemplateRequestBuildersetSource(java.util.Map<java.lang.String,java.lang.Object> templateSource)The template source definition.PutIndexTemplateRequestBuildersetSource(BytesReference templateSource, XContentType xContentType)The template source definition.PutIndexTemplateRequestBuildersetSource(XContentBuilder templateBuilder)The template source definition.PutIndexTemplateRequestBuildersetVersion(java.lang.Integer version)Sets the optional version of this template.-
Methods inherited from class org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder
setMasterNodeTimeout, setMasterNodeTimeout
-
-
-
-
Constructor Detail
-
PutIndexTemplateRequestBuilder
public PutIndexTemplateRequestBuilder(ElasticsearchClient client, PutIndexTemplateAction action)
-
PutIndexTemplateRequestBuilder
public PutIndexTemplateRequestBuilder(ElasticsearchClient client, PutIndexTemplateAction action, java.lang.String name)
-
-
Method Detail
-
setPatterns
public PutIndexTemplateRequestBuilder setPatterns(java.util.List<java.lang.String> indexPatterns)
Sets the match expression that will be used to match on indices created.
-
setOrder
public PutIndexTemplateRequestBuilder setOrder(int order)
Sets the order of this template if more than one template matches.
-
setVersion
public PutIndexTemplateRequestBuilder setVersion(java.lang.Integer version)
Sets the optional version of this template.
-
setCreate
public PutIndexTemplateRequestBuilder setCreate(boolean create)
Set totrueto force only creation, not an update of an index template. If it already exists, it will fail with anIllegalArgumentException.
-
setSettings
public PutIndexTemplateRequestBuilder setSettings(Settings settings)
The settings to created the index template with.
-
setSettings
public PutIndexTemplateRequestBuilder setSettings(Settings.Builder settings)
The settings to created the index template with.
-
setSettings
public PutIndexTemplateRequestBuilder setSettings(java.lang.String source, XContentType xContentType)
The settings to crete the index template with (either json or yaml format)
-
setSettings
public PutIndexTemplateRequestBuilder setSettings(java.util.Map<java.lang.String,java.lang.Object> source)
The settings to crete the index template with (either json or yaml format)
-
addMapping
public PutIndexTemplateRequestBuilder addMapping(java.lang.String type, java.lang.String source, XContentType xContentType)
Adds mapping that will be added when the index template gets created.- Parameters:
type- The mapping typesource- The mapping sourcexContentType- The type/format of the source
-
addMapping
public PutIndexTemplateRequestBuilder addMapping(java.lang.String type, java.lang.Object... source)
A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").
-
setAliases
public PutIndexTemplateRequestBuilder setAliases(java.util.Map<java.lang.String,java.lang.Object> source)
Sets the aliases that will be associated with the index when it gets created
-
setAliases
public PutIndexTemplateRequestBuilder setAliases(java.lang.String source)
Sets the aliases that will be associated with the index when it gets created
-
setAliases
public PutIndexTemplateRequestBuilder setAliases(XContentBuilder source)
Sets the aliases that will be associated with the index when it gets created
-
setAliases
public PutIndexTemplateRequestBuilder setAliases(BytesReference source)
Sets the aliases that will be associated with the index when it gets created
-
addAlias
public PutIndexTemplateRequestBuilder addAlias(Alias alias)
Adds an alias that will be added when the index template gets created.- Parameters:
alias- The alias- Returns:
- the request builder
-
cause
public PutIndexTemplateRequestBuilder cause(java.lang.String cause)
The cause for this index template creation.
-
addMapping
public PutIndexTemplateRequestBuilder addMapping(java.lang.String type, XContentBuilder source)
Adds mapping that will be added when the index template gets created.- Parameters:
type- The mapping typesource- The mapping source
-
addMapping
public PutIndexTemplateRequestBuilder addMapping(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> source)
Adds mapping that will be added when the index gets created.- Parameters:
type- The mapping typesource- The mapping source
-
setSource
public PutIndexTemplateRequestBuilder setSource(XContentBuilder templateBuilder)
The template source definition.
-
setSource
public PutIndexTemplateRequestBuilder setSource(java.util.Map<java.lang.String,java.lang.Object> templateSource)
The template source definition.
-
setSource
public PutIndexTemplateRequestBuilder setSource(BytesReference templateSource, XContentType xContentType)
The template source definition.
-
setSource
public PutIndexTemplateRequestBuilder setSource(byte[] templateSource, XContentType xContentType)
The template source definition.
-
setSource
public PutIndexTemplateRequestBuilder setSource(byte[] templateSource, int offset, int length, XContentType xContentType)
The template source definition.
-
-