Bird
Raised Fist0

What is wrong with this command to update replicas?

medium📝 Debug Q6 of Q15
Elasticsearch - Performance and Scaling

What is wrong with this command to update replicas?
PUT /my_index/_settings { "number_of_replicas": "two" }

AThe HTTP method should be POST, not PUT
BThe number_of_replicas value must be an integer, not a string
CThe endpoint is incorrect; it should be /_replicas
DThe JSON body is missing a root key
Step-by-Step Solution
Solution:
  1. Step 1: Check data type of number_of_replicas

    It must be a number (integer), not a string like "two".
  2. Step 2: Verify other parts of the command

    PUT method and endpoint are correct; JSON body format is valid.
  3. Final Answer:

    The number_of_replicas value must be an integer, not a string -> Option B
  4. Quick Check:

    Replica count must be integer [OK]
Quick Trick: Replica count must be a number, not text [OK]
Common Mistakes:
MISTAKES
  • Using string instead of integer for replicas
  • Confusing HTTP methods for settings update
  • Wrong endpoint for updating replicas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes