Bird
0
0

Given the following request: GET /library/_doc/42, what will Elasticsearch return if the document with ID '42' does not exist?

medium📝 Predict Output Q4 of 15
Elasticsearch - Document Operations
Given the following request: GET /library/_doc/42, what will Elasticsearch return if the document with ID '42' does not exist?
AA JSON with 'found': false and no _source
BAn empty JSON object {}
CA 500 internal server error
DA 404 status with 'not_found' error
Step-by-Step Solution
Solution:
  1. Step 1: Understand Elasticsearch response for missing document

    When a document is not found, Elasticsearch returns JSON with 'found': false.
  2. Step 2: Identify correct response format

    A JSON with 'found': false and no _source correctly describes the response with 'found': false and no _source field.
  3. Final Answer:

    A JSON with 'found': false and no _source -> Option A
  4. Quick Check:

    Missing doc response includes 'found': false [OK]
Quick Trick: Missing doc returns JSON with 'found': false, not 404 [OK]
Common Mistakes:
MISTAKES
  • Expecting HTTP 404 error
  • Expecting empty JSON
  • Confusing with server error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes