Bird
Raised Fist0

Which JSON structure correctly initiates a scroll search request in Elasticsearch to retrieve 100 documents with a 2-minute scroll timeout?

easy📝 Syntax Q3 of Q15
Elasticsearch - Advanced Patterns
Which JSON structure correctly initiates a scroll search request in Elasticsearch to retrieve 100 documents with a 2-minute scroll timeout?
A{ "scroll": "100", "size": "2m", "query": { "match_all": {} } }
B{ "scroll_id": "2m", "size": 100, "query": { "match_all": {} } }
C{ "size": 100, "scroll": "2m", "query": { "match_all": {} } }
D{ "query": { "match_all": {} }, "scroll_id": "2m", "size": 100 }
Step-by-Step Solution
Solution:
  1. Step 1: Specify the scroll timeout

    The scroll parameter defines how long Elasticsearch keeps the search context alive.
  2. Step 2: Set the batch size

    The size parameter controls how many documents are returned per batch.
  3. Step 3: Provide the query

    Using match_all retrieves all documents.
  4. Final Answer:

    { "size": 100, "scroll": "2m", "query": { "match_all": {} } } -> Option C
  5. Quick Check:

    Scroll timeout and size must be correctly placed [OK]
Quick Trick: Use 'scroll' for timeout and 'size' for batch size [OK]
Common Mistakes:
MISTAKES
  • Confusing 'scroll' with 'scroll_id'
  • Setting 'scroll' as a number instead of a time string
  • Placing 'scroll_id' in initial request

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes