0
0
Elasticsearchquery~10 mins

Creating an index 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 create an index named "library".

Elasticsearch
{
  "[1]": "library"
}
Drag options to blanks, or click blank then click option'
Atype
Bid
Cname
Dindex
Attempts:
3 left
💡 Hint
Common Mistakes
Using "type" instead of "index"
Using "name" which is not recognized
Using "id" which is unrelated
2fill in blank
medium

Complete the code to set the number of shards to 3 in the index settings.

Elasticsearch
{
  "settings": {
    "number_of_shards": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"3"
B"three"
C3
Dshards
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number in quotes making it a string
Using the word "three" instead of the number
Using an unrelated string like "shards"
3fill in blank
hard

Fix the error in the mapping by completing the field type for "title".

Elasticsearch
{
  "mappings": {
    "properties": {
      "title": {
        "type": "[1]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astring
Btext
Ckeyword
Dfield
Attempts:
3 left
💡 Hint
Common Mistakes
Using "string" which is not a valid type in recent Elasticsearch versions
Using "keyword" which is for exact matches, not full text
Using "field" which is invalid
4fill in blank
hard

Fill both blanks to set the number of replicas to 2 and refresh interval to 1s.

Elasticsearch
{
  "settings": {
    "number_of_replicas": [1],
    "refresh_interval": "[2]"
  }
}
Drag options to blanks, or click blank then click option'
A2
B1s
C3
D5s
Attempts:
3 left
💡 Hint
Common Mistakes
Putting refresh interval as a number without quotes
Using wrong numbers for replicas
Using invalid time units
5fill in blank
hard

Fill all three blanks to create a mapping for a "date" field named "publish_date" with format "yyyy-MM-dd".

Elasticsearch
{
  "mappings": {
    "properties": {
      "[1]": {
        "type": "[2]",
        "format": "[3]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Apublish_date
Bdate
Cyyyy-MM-dd
Dtext
Attempts:
3 left
💡 Hint
Common Mistakes
Using "text" as type instead of "date"
Using wrong format strings
Mixing field name and type