Bird
0
0

You want to update multiple documents matching a query to set their status to "archived". Which Elasticsearch API should you use?

hard🚀 Application Q8 of 15
Elasticsearch - Document Operations
You want to update multiple documents matching a query to set their status to "archived". Which Elasticsearch API should you use?
AThe <code>_delete_by_query</code> API
BThe <code>_update_by_query</code> API
CThe <code>_bulk</code> API with update actions for each document
DThe <code>_update</code> API with a wildcard ID
Step-by-Step Solution
Solution:
  1. Step 1: Identify API for updating multiple documents by query

    The _update_by_query API updates all documents matching a query.
  2. Step 2: Compare other options

    _update requires document ID, _bulk can update multiple but needs explicit actions, _delete_by_query deletes documents.
  3. Final Answer:

    The _update_by_query API -> Option B
  4. Quick Check:

    Multiple update by query = _update_by_query [OK]
Quick Trick: Use _update_by_query to update many documents at once [OK]
Common Mistakes:
MISTAKES
  • Using _update with wildcard ID
  • Confusing bulk with update_by_query
  • Using delete_by_query instead

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes