Bird
Raised Fist0

Given the following scroll response snippet, what is the correct next step to fetch more results?

medium📝 Predict Output Q13 of Q15
Elasticsearch - Advanced Patterns
Given the following scroll response snippet, what is the correct next step to fetch more results?
{
  "_scroll_id": "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAA",
  "hits": {"hits": [{"_id": "1"}, {"_id": "2"}]}
}
ASend a new search request without scroll_id.
BDelete the scroll_id to reset the scroll context.
CUse the scroll_id in a subsequent scroll request with the scroll parameter.
DUse the hits array to manually fetch documents by ID.
Step-by-Step Solution
Solution:
  1. Step 1: Understand scroll continuation

    To get next batch, use the scroll_id from previous response with scroll parameter.
  2. Step 2: Evaluate options

    Use the scroll_id in a subsequent scroll request with the scroll parameter. correctly describes using scroll_id and scroll to continue. Send a new search request without scroll_id. restarts search, losing context. Delete the scroll_id to reset the scroll context. is incorrect as deleting scroll_id is not valid. Use the hits array to manually fetch documents by ID. is manual and inefficient.
  3. Final Answer:

    Use the scroll_id in a subsequent scroll request with the scroll parameter. -> Option C
  4. Quick Check:

    Next scroll = scroll_id + scroll [OK]
Quick Trick: Use scroll_id + scroll param to get next batch [OK]
Common Mistakes:
MISTAKES
  • Restarting search instead of continuing scroll
  • Ignoring scroll parameter in next request
  • Trying to fetch documents manually by ID

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes