Bird
Raised Fist0

You want to optimize cache clearing by only clearing fielddata cache for fields starting with user_. Which approach is correct?

hard🚀 Application Q9 of Q15
Elasticsearch - Performance and Scaling
You want to optimize cache clearing by only clearing fielddata cache for fields starting with user_. Which approach is correct?
AUse <code>POST /index/_cache/clear</code> with <code>{ "fielddata": { "fields": ["user_*"] } }</code>
BUse <code>POST /index/_cache/clear</code> with <code>{ "fielddata": true }</code> and rely on automatic filtering
CUse <code>POST /index/_cache/clear</code> with <code>{ "query": true }</code> and filter fields in query
DFielddata cache cannot be cleared selectively by field patterns
Step-by-Step Solution
Solution:
  1. Step 1: Understand selective fielddata cache clearing

    Elasticsearch allows clearing fielddata cache selectively by specifying fields in the JSON body.
  2. Step 2: Verify correct JSON syntax

    Using { "fielddata": { "fields": ["user_*"] } } clears fielddata cache only for fields matching the pattern.
  3. Final Answer:

    Use POST /index/_cache/clear with { "fielddata": { "fields": ["user_*"] } } -> Option A
  4. Quick Check:

    Fielddata cache can be cleared selectively by fields [OK]
Quick Trick: Specify fields array in fielddata cache clear JSON to target fields [OK]
Common Mistakes:
MISTAKES
  • Assuming fielddata cache clears all fields only
  • Using query cache key to clear fielddata
  • Believing selective clearing is unsupported

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes