Query parameters
-
If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.
-
User defined reason for dry-run creating the new template for simulation purposes
-
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.
Values are
-1or0.External documentation -
If true, returns all relevant default configurations for the index template.
Body
-
This setting overrides the value of the
action.auto_create_indexcluster setting. If set totruein a template, then indices can be automatically created using that template even if auto-creation of indices is disabled viaactions.auto_create_index. If set tofalse, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. -
Array of wildcard (
*) expressions used to match the names of data streams and indices during creation. -
An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.
-
Template to be applied. It may optionally include an
aliases,mappings, orsettingsconfiguration.Hide template attributes Show template attributes object
-
Aliases to add. If the index template includes a
data_streamobject, these are data stream aliases. Otherwise, these are index aliases. Data stream aliases ignore theindex_routing,routing, andsearch_routingoptions.Hide aliases attribute Show aliases attribute object
-
Hide * attributes Show * attributes object
-
Query used to limit documents the alias can access.
External documentation Hide filter attributes Show filter attributes object
-
Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.
-
Matches
geo_pointandgeo_shapevalues that intersect a grid cell from a GeoGrid aggregation. -
Returns documents based on the order and proximity of matching terms.
-
Returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching.
-
Analyzes its input and constructs a
boolquery from the terms. Each term except the last is used in atermquery. The last term is used in a prefix query. -
Analyzes the text and creates a phrase query out of the analyzed text.
-
Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term.
-
Returns documents that contain a specific prefix in a provided field.
-
Returns documents that contain terms within a provided range.
-
Returns documents that contain terms matching a regular expression.
-
Matches spans containing a term.
-
Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.
-
Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of terms must exactly match the field values, including whitespace and capitalization.
-
Uses a natural language processing model to convert the query text into a list of token-weight pairs which are then used in a query against a sparse vector or rank features field.
-
Supports returning text_expansion query results by sending in precomputed tokens with the query.
-
Returns documents that contain terms matching a wildcard pattern.
-
Value used to route indexing operations to a specific shard. If specified, this overwrites the
routingvalue for indexing operations. -
If
true, the alias is hidden. All indices for the alias must have the sameis_hiddenvalue.Default value is
false. -
If
true, the index is the write index for the alias.Default value is
false. -
Value used to route indexing and search operations to a specific shard.
-
Value used to route search operations to a specific shard. If specified, this overwrites the
routingvalue for search operations.
-
-
-
Mapping for fields in the index. If specified, this mapping can include field names, field data types, and mapping parameters.
Hide mappings attributes Show mappings attributes object
-
Hide all_field attributes Show all_field attributes object
-
Values are
strict,runtime,true, orfalse. -
-
Values are
trueorfalse.
-
-
Configuration options for the index.
Hide settings attributes Show settings attributes object
-
Values are
true,false, orchecksum. -
Default value is
LZ4. -
Default value is
true. auto_expand_replicas
string | null -
A duration. Units can be
nanos,micros,ms(milliseconds),s(seconds),m(minutes),h(hours) andd(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.External documentation -
Default value is
10000.0. -
Default value is
100.0. -
Default value is
10000.0. -
Default value is
100.0. -
Default value is
32.0. -
Default value is
1.0. -
Default value is
3.0. -
Settings to define analyzers, tokenizers, token filters and character filters. Refer to the linked documentation for step-by-step examples of updating analyzers on existing indices.
External documentation -
Default value is
65536.0. -
Default value is
1000.0. -
A duration. Units can be
nanos,micros,ms(milliseconds),s(seconds),m(minutes),h(hours) andd(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.External documentation -
Hide lifecycle attributes Show lifecycle attributes object
-
If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting if you create a new index that contains old data and want to use the original creation date to calculate the index age. Specified as a Unix epoch value in milliseconds.
Default value is
0.0. -
Set to true to parse the origination date from the index name. This origination date is used to calculate the index age for its phase transitions. The index name must match the pattern .*-{date_format}-\d+, where the date_format is yyyy.MM.dd and the trailing digits are optional. An index that was rolled over would normally match the full format, for example logs-2016.10.31-000002). If the index name doesn’t match the pattern, index creation fails.
-
The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action. When the index rolls over, the alias is updated to reflect that the index is no longer the write index. For more information about rolling indices, see Rollover.
Default value is empty.
-
-
Configure custom similarity settings to customize how search results are scored.
-
Enable or disable dynamic mapping for an index.
-
Configure indexing back pressure limits.
-
The store module allows you to control how index data is stored and accessed on disk.
Hide store attribute Show store attribute object
-
You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap. This is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This setting is useful, for example, if you are in an environment where you can not control the ability to create a lot of memory maps so you need disable the ability to use memory-mapping.
-
-
Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.
Hide lifecycle attributes Show lifecycle attributes object
-
If defined, every document added to this data stream will be stored at least for this time frame. Any time after this duration the document could be deleted. When empty, every document in this data stream will be stored indefinitely.
External documentation -
The list of downsampling rounds to execute as part of this downsampling configuration
-
The method used to downsample the data. There are two options
aggregateandlast_value. It requiresdownsamplingto be defined. Defaults toaggregate.Values are
aggregateorlast_value. -
If defined, it turns data stream lifecycle on/off (
true/false) for this data stream. A data stream lifecycle that's disabled (enabled:false) will have no effect on the data stream.Default value is
true. -
Only available with feature flag dlm_searchable_snapshots.
External documentation
-
-
-
If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a
data_streamobject. -
Priority to determine index template precedence when a new data stream or index is created. The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by Elasticsearch.
-
Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.
-
Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.
-
The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist
-
Marks this index template as deprecated. When creating or updating a non-deprecated index template that uses deprecated components, Elasticsearch will emit a deprecation warning.
Responses
-
Hide response attributes Show response attributes object
-
Hide template attributes Show template attributes object
-
Hide aliases attribute Show aliases attribute object
-
Hide * attributes Show * attributes object
-
Query used to limit documents the alias can access.
-
Value used to route indexing operations to a specific shard. If specified, this overwrites the
routingvalue for indexing operations. -
If
true, the alias is hidden. All indices for the alias must have the sameis_hiddenvalue.Default value is
false. -
If
true, the index is the write index for the alias.Default value is
false. -
Value used to route indexing and search operations to a specific shard.
-
Value used to route search operations to a specific shard. If specified, this overwrites the
routingvalue for search operations.
-
-
-
Hide mappings attributes Show mappings attributes object
-
Values are
strict,runtime,true, orfalse. -
-
Values are
trueorfalse.
-
Hide settings attributes Show settings attributes object
-
Values are
true,false, orchecksum. -
Default value is
LZ4. -
Default value is
true. auto_expand_replicas
string | null -
A duration. Units can be
nanos,micros,ms(milliseconds),s(seconds),m(minutes),h(hours) andd(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
Default value is
10000.0. -
Default value is
100.0. -
Default value is
10000.0. -
Default value is
100.0. -
Default value is
32.0. -
Default value is
1.0. -
Default value is
3.0. -
Settings to define analyzers, tokenizers, token filters and character filters. Refer to the linked documentation for step-by-step examples of updating analyzers on existing indices.
-
Default value is
65536.0. -
Default value is
1000.0. -
A duration. Units can be
nanos,micros,ms(milliseconds),s(seconds),m(minutes),h(hours) andd(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
Configure custom similarity settings to customize how search results are scored.
-
Enable or disable dynamic mapping for an index.
-
Configure indexing back pressure limits.
-
The store module allows you to control how index data is stored and accessed on disk.
-
curl \
--request POST 'http://api.example.com/_index_template/_simulate' \
--header "Content-Type: application/json" \
--data '"{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n}"'
{
"index_patterns": ["my-index-*"],
"composed_of": ["ct2"],
"priority": 10,
"template": {
"settings": {
"index.number_of_replicas": 1
}
}
}
{
"template" : {
"settings" : {
"index" : {
"number_of_replicas" : "1",
"routing" : {
"allocation" : {
"include" : {
"_tier_preference" : "data_content"
}
}
}
}
},
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
}
}
},
"aliases" : { }
},
"overlapping" : [
{
"name" : "final-template",
"index_patterns" : [
"my-index-*"
]
}
]
}