Class PutTemplateRequest
- All Implemented Interfaces:
JsonpSerializable
IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
Composable templates always take precedence over legacy templates. If no composable template matches a new index, matching legacy templates are applied according to their order.
Index templates are only applied during index creation. Changes to index templates do not affect existing indices. Settings and mappings specified in create index API requests override any settings or mappings specified in an index template.
You can use C-style /* *\/ block comments in index templates.
You can include comments anywhere in the request body, except before the
opening curly bracket.
Indices matching multiple templates
Multiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index. The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them. NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<PutTemplateRequest>Deprecated.Json deserializer forPutTemplateRequeststatic final Endpoint<PutTemplateRequest,PutTemplateResponse, ErrorResponse> Deprecated.Endpoint "indices.put_template". -
Method Summary
Modifier and TypeMethodDescriptionaliases()Deprecated.Aliases for the index.final Stringcause()Deprecated.User defined reason for creating/updating the index templatefinal Booleancreate()Deprecated.If true, this request cannot replace or update existing index templates.Deprecated.Array of wildcard expressions used to match the names of indices during creation.final TypeMappingmappings()Deprecated.Mapping for fields in the index.final TimeDeprecated.Period to wait for a connection to the master node.final Stringname()Deprecated.Required - The name of the templatestatic PutTemplateRequestDeprecated.final Integerorder()Deprecated.Order in which Elasticsearch applies this template if index matches multiple templates.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Deprecated.Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Deprecated.final IndexSettingssettings()Deprecated.Configuration options for the index.protected static voidDeprecated.final Longversion()Deprecated.Version number used to manage index templates externally.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Deprecated.Json deserializer forPutTemplateRequest -
_ENDPOINT
Deprecated.Endpoint "indices.put_template".
-
-
Method Details
-
of
public static PutTemplateRequest of(Function<PutTemplateRequest.Builder, ObjectBuilder<PutTemplateRequest>> fn) Deprecated. -
aliases
Deprecated.Aliases for the index.API name:
aliases -
cause
Deprecated.User defined reason for creating/updating the index templateAPI name:
cause -
create
Deprecated.If true, this request cannot replace or update existing index templates.API name:
create -
indexPatterns
Deprecated.Array of wildcard expressions used to match the names of indices during creation.API name:
index_patterns -
mappings
Deprecated.Mapping for fields in the index.API name:
mappings -
masterTimeout
Deprecated.Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.API name:
master_timeout -
name
Deprecated.Required - The name of the templateAPI name:
name -
order
Deprecated.Order in which Elasticsearch applies this template if index matches multiple templates.Templates with lower 'order' values are merged first. Templates with higher 'order' values are merged later, overriding templates with lower values.
API name:
order -
settings
Deprecated.Configuration options for the index.API name:
settings -
version
Deprecated.Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. To unset a version, replace the template without specifying one.API name:
version -
serialize
Deprecated.Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
Deprecated. -
setupPutTemplateRequestDeserializer
protected static void setupPutTemplateRequestDeserializer(ObjectDeserializer<PutTemplateRequest.Builder> op) Deprecated.
-