Challenge - 5 Problems
Index Template Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
What is the output of this index template creation?
Given this Elasticsearch index template creation command, what will be the number of shards for any new index matching the pattern?
Elasticsearch
{
"index_patterns": ["logs-*"],
"template": {
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1
}
}
}Attempts:
2 left
💡 Hint
Look at the settings inside the template for shards and replicas.
✗ Incorrect
The template explicitly sets number_of_shards to 3 and number_of_replicas to 1, so any new index matching 'logs-*' will inherit these settings.
🧠 Conceptual
intermediate1:30remaining
What is the main purpose of an index template in Elasticsearch?
Choose the best description of what an index template does.
Attempts:
2 left
💡 Hint
Think about how you can prepare new indices before they are created.
✗ Incorrect
Index templates define settings and mappings that automatically apply to new indices matching specified patterns.
📝 Syntax
advanced2:30remaining
Which option correctly defines an index template with a priority of 10?
Select the valid JSON snippet that sets an index template with priority 10.
Attempts:
2 left
💡 Hint
Priority is a top-level field, not inside template.
✗ Incorrect
Priority must be a top-level field with a numeric value. Option A correctly places priority at the top level with a number 10.
❓ optimization
advanced3:00remaining
How can you optimize index templates to reduce duplication when multiple templates share settings?
Which approach best reduces duplication across multiple index templates?
Attempts:
2 left
💡 Hint
Think about reusable building blocks in Elasticsearch templates.
✗ Incorrect
Component templates allow reusable settings and mappings that can be composed into multiple index templates, reducing duplication.
🔧 Debug
expert3:00remaining
Why does this index template fail to apply settings to new indices?
Given this template JSON, why won't new indices matching 'data-*' get the custom analyzer?
{
"index_patterns": ["data-*"],
"settings": {
"analysis": {
"analyzer": {
"custom_lowercase": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase"]
}
}
}
}
}
Attempts:
2 left
💡 Hint
Check the required structure of an index template JSON.
✗ Incorrect
In Elasticsearch index templates, the 'settings' must be nested inside a 'template' object. Placing 'settings' at the top level causes the template to be ignored.