0
0
Elasticsearchquery~10 mins

Dynamic vs explicit mapping in Elasticsearch - Interactive Practice

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

Complete the code to enable dynamic mapping in Elasticsearch index creation.

Elasticsearch
{
  "mappings": {
    "dynamic": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"strict"
BTrue
CFalse
D"enabled"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string "true" instead of boolean true.
Confusing true with invalid "enabled".
2fill in blank
medium

Complete the explicit mapping to define a text field with keyword subfield.

Elasticsearch
{
  "properties": {
    "title": {
      "type": [1],
      "fields": {
        "keyword": {
          "type": "keyword"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"text"
B"date"
C"keyword"
D"integer"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'keyword' as main type instead of 'text'.
Confusing 'integer' or 'date' types for text fields.
3fill in blank
hard

Fix the error in the mapping to disable dynamic mapping.

Elasticsearch
{
  "mappings": {
    "dynamic": [1]
  }
}
Drag options to blanks, or click blank then click option'
AFalse
B"enabled"
CTrue
D"disabled"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string "false" instead of boolean false.
Using "disabled" which is not a valid value.
4fill in blank
hard

Fill both blanks to define an explicit mapping for a date field with a custom format.

Elasticsearch
{
  "properties": {
    "created_at": {
      "type": [1],
      "format": [2]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"date"
B"text"
C"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
D"keyword"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' or 'keyword' as type for date fields.
Not providing the format string or using wrong format.
5fill in blank
hard

Fill all three blanks to create a mapping with dynamic disabled, and explicit properties for name and age.

Elasticsearch
{
  "dynamic": [1],
  "properties": {
    "name": {
      "type": [2]
    },
    "age": {
      "type": [3]
    }
  }
}
Drag options to blanks, or click blank then click option'
AFalse
B"text"
C"integer"
D"keyword"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string "false" instead of boolean false.
Confusing 'keyword' with 'text' for name field.
Using 'text' for age instead of 'integer'.