0
0
Elasticsearchquery~10 mins

Component templates in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a component template with a settings block.

Elasticsearch
{
  "template": {
    "settings": [1]
  }
}
Drag options to blanks, or click blank then click option'
Anumber_of_shards: 1
B["number_of_shards", 1]
C"number_of_shards: 1"
D{"number_of_shards": 1}
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets instead of curly braces for settings.
Not quoting keys or values properly.
2fill in blank
medium

Complete the code to add a mappings block with a dynamic template.

Elasticsearch
{
  "template": {
    "mappings": {
      "dynamic_templates": [
        {
          "strings_as_keywords": {
            "match_mapping_type": [1]
          }
        }
      ]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"string"
B"keyword"
C"text"
D"integer"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "keyword" instead of "string" for match_mapping_type.
Using incorrect data types like "integer".
3fill in blank
hard

Fix the error in the component template by completing the lifecycle policy reference.

Elasticsearch
{
  "template": {
    "settings": {
      "index.lifecycle.name": [1]
    }
  }
}
Drag options to blanks, or click blank then click option'
Apolicy_1
B"policy_1"
Cpolicy1
D'policy_1'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the policy name, causing JSON errors.
Using single quotes instead of double quotes.
4fill in blank
hard

Fill both blanks to create a component template with an alias and a priority.

Elasticsearch
{
  "template": {
    "aliases": {
      "[1]": {}
    },
    "priority": [2]
  }
}
Drag options to blanks, or click blank then click option'
Alogs_alias
B5
C10
Dmetrics_alias
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number as an alias name.
Using a string for priority instead of a number.
5fill in blank
hard

Fill all three blanks to define a component template with settings, mappings, and aliases.

Elasticsearch
{
  "template": {
    "settings": [1],
    "mappings": [2],
    "aliases": {
      "[3]": {}
    }
  }
}
Drag options to blanks, or click blank then click option'
A{"number_of_replicas": 2}
B{"properties": {"field1": {"type": "keyword"}}}
Capp_logs
D{"number_of_shards": 3}
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up settings and mappings blocks.
Not quoting alias names properly.