Bird
Raised Fist0

If you want to retrieve 12,000 documents using the Scroll API with a batch size of 400, how many total scroll requests (including the initial search) must you perform?

hard🚀 Application Q8 of Q15
Elasticsearch - Advanced Patterns
If you want to retrieve 12,000 documents using the Scroll API with a batch size of 400, how many total scroll requests (including the initial search) must you perform?
A31
B30
C29
D32
Step-by-Step Solution
Solution:
  1. Step 1: Calculate total batches

    Divide total documents by batch size: 12000 / 400 = 30 batches.
  2. Step 2: Count requests

    The initial search request returns the first batch, so total requests = number of batches.
  3. Step 3: Verify if an extra request is needed

    Since 12000 is exactly divisible by 400, 30 batches are needed, but the initial request counts as one, so total requests = 30.
  4. Step 4: Reconsider counting

    Actually, the initial search is the first request, then 29 scroll requests to get remaining batches, total 30 requests.
  5. Final Answer:

    30 -> Option B
  6. Quick Check:

    Total requests = total batches = 30 [OK]
Quick Trick: Total requests equal total batches (ceil division) [OK]
Common Mistakes:
MISTAKES
  • Adding an extra request unnecessarily
  • Not including the initial search request
  • Incorrect division without ceiling

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes