0
0
Elasticsearchquery~10 mins

Index settings (shards, replicas) 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 set the number of primary shards to 3.

Elasticsearch
{
  "settings": {
    "number_of_shards": [1]
  }
}
Drag options to blanks, or click blank then click option'
A5
B0
C1
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Setting shards to 0 is invalid because an index must have at least one shard.
Choosing too many shards can cause overhead.
2fill in blank
medium

Complete the code to set the number of replicas to 2.

Elasticsearch
{
  "settings": {
    "number_of_replicas": [1]
  }
}
Drag options to blanks, or click blank then click option'
A1
B2
C-1
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Negative numbers are invalid for replicas.
Setting replicas too high wastes resources.
3fill in blank
hard

Fix the error in the code to correctly set shards to 1.

Elasticsearch
{
  "settings": {
    "number_of_shards": [1]
  }
}
Drag options to blanks, or click blank then click option'
A1
Bone
Ctrue
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like "one" instead of a number.
Using boolean or null values.
4fill in blank
hard

Fill both blanks to set shards to 4 and replicas to 1.

Elasticsearch
{
  "settings": {
    "number_of_shards": [1],
    "number_of_replicas": [2]
  }
}
Drag options to blanks, or click blank then click option'
A4
B1
C3
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up shards and replicas values.
Using zero for shards which is invalid.
5fill in blank
hard

Fill all three blanks to set shards to 2, replicas to 0, and refresh interval to 1s.

Elasticsearch
{
  "settings": {
    "number_of_shards": [1],
    "number_of_replicas": [2],
    "refresh_interval": "[3]"
  }
}
Drag options to blanks, or click blank then click option'
A1
B0
C2
D1s
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers in quotes for shards or replicas.
Using invalid refresh interval formats.