Complete the code to set the number of primary shards to 3.
{
"settings": {
"number_of_shards": [1]
}
}The number_of_shards setting controls how many primary shards the index has. Setting it to 3 means the index will be split into 3 parts.
Complete the code to set the number of replicas to 2.
{
"settings": {
"number_of_replicas": [1]
}
}The number_of_replicas setting controls how many copies of each shard are kept for fault tolerance. Setting it to 2 means there will be two copies of each shard.
Fix the error in the code to correctly set shards to 1.
{
"settings": {
"number_of_shards": [1]
}
}The number_of_shards must be a number, not a string or other type. Using 1 as a number is correct.
Fill both blanks to set shards to 4 and replicas to 1.
{
"settings": {
"number_of_shards": [1],
"number_of_replicas": [2]
}
}Setting number_of_shards to 4 splits the index into 4 parts. Setting number_of_replicas to 1 keeps one copy of each shard for safety.
Fill all three blanks to set shards to 2, replicas to 0, and refresh interval to 1s.
{
"settings": {
"number_of_shards": [1],
"number_of_replicas": [2],
"refresh_interval": "[3]"
}
}Setting number_of_shards to 2 splits the index into two parts. Setting number_of_replicas to 0 means no copies. The refresh_interval of "1s" means the index refreshes every second.