Bird
Raised Fist0

Which of the following is the correct syntax to clear the query cache for an index named products using Elasticsearch REST API?

easy📝 Syntax Q12 of Q15
Elasticsearch - Performance and Scaling
Which of the following is the correct syntax to clear the query cache for an index named products using Elasticsearch REST API?
APOST /products/_cache/clear?query=true
BPOST /products/_cache/clear/query
CPOST /products/_cache/clear/fielddata
DPOST /products/_clear_cache/query
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct REST API endpoint for clearing cache

    Elasticsearch uses _cache/clear with query parameters to specify cache types.
  2. Step 2: Identify the correct parameter for query cache

    The query cache is cleared by adding ?query=true to the endpoint.
  3. Final Answer:

    POST /products/_cache/clear?query=true -> Option A
  4. Quick Check:

    Use query=true parameter to clear query cache [OK]
Quick Trick: Use query=true parameter to clear query cache [OK]
Common Mistakes:
MISTAKES
  • Using wrong endpoint like _clear_cache
  • Confusing fielddata cache with query cache
  • Missing query parameter in URL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes