0
0
Elasticsearchquery~20 mins

Async search for expensive queries in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Async Search Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this async search initiation?
Given the following Elasticsearch async search request, what is the expected immediate response field that indicates the search is running asynchronously?
Elasticsearch
{
  "index": "products",
  "body": {
    "query": {
      "match_all": {}
    }
  },
  "wait_for_completion_timeout": "1s",
  "keep_alive": "5m"
}
A"error" field indicating query failure
B"hits" field with all matching documents immediately
C"id" field with a unique search ID
D"status" field with value "completed"
Attempts:
2 left
💡 Hint
Async search returns a search ID to track progress, not full results immediately.
🧠 Conceptual
intermediate
1:30remaining
Why use async search for expensive queries?
Which reason best explains why async search is preferred for expensive or long-running Elasticsearch queries?
AIt runs queries only on a single node to reduce load
BIt allows the client to retrieve partial results immediately and poll for completion later
CIt automatically caches all query results permanently
DIt disables query timeout to avoid failures
Attempts:
2 left
💡 Hint
Think about how async search helps with long wait times.
🔧 Debug
advanced
2:00remaining
Identify the error in this async search status request
This request tries to get the status of an async search but fails. What is the cause?
Elasticsearch
GET /_async_search/status
{
  "id": "r1a2b3c4d5e6f7g8h9"
}
AThe search ID should be in the URL path, not in the request body
BThe request must include an index name
CThe endpoint should be /_async_search/result, not /_async_search/status
DThe HTTP method should be POST, not GET
Attempts:
2 left
💡 Hint
Check how the async search ID is passed in the API.
📝 Syntax
advanced
2:00remaining
Which async search request syntax is correct?
Choose the correct syntax to start an async search with a 2-second wait and 10-minute keep alive.
A
POST /_async_search
{
  "query": { "match_all": {} },
  "wait_for_completion_timeout": "2s",
  "keep_alive": "10m"
}
B
POST /_search/async
{
  "query": { "match_all": {} },
  "wait_for_completion_timeout": "2s",
  "keep_alive": "10m"
}
C
GET /_async_search
{
  "query": { "match_all": {} },
  "wait_for_completion_timeout": "2s",
  "keep_alive": "10m"
}
D
POST /_async_search?wait_for_completion_timeout=2s&keep_alive=10m
{
  "query": { "match_all": {} }
}
Attempts:
2 left
💡 Hint
Check the correct HTTP method and parameter placement for async search.
🚀 Application
expert
2:30remaining
How to retrieve final results of an async search?
After starting an async search and receiving the search ID "abc123", which request correctly retrieves the final results once the search is complete?
AGET /_async_search/abc123
B
POST /_async_search/result
{
  "id": "abc123"
}
CGET /_async_search/status/abc123
DGET /_search/async/abc123
Attempts:
2 left
💡 Hint
Think about the endpoint to get results by search ID.