Challenge - 5 Problems
Search Performance Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Elasticsearch query?
Given the following Elasticsearch query, what will be the total number of hits returned?
Elasticsearch
{
"query": {
"bool": {
"must": [
{ "match": { "title": "python" } },
{ "range": { "publish_year": { "gte": 2015 } } }
]
}
},
"size": 5
}Attempts:
2 left
💡 Hint
Check how the bool query combines must clauses and the size parameter limits results.
✗ Incorrect
The bool query with must clauses requires both conditions to be true. The size limits results to 5 documents matching both conditions.
🧠 Conceptual
intermediate2:00remaining
Which setting improves search speed by reducing scoring calculations?
In Elasticsearch, which setting can you use to improve search performance by skipping scoring calculations when relevance is not important?
Attempts:
2 left
💡 Hint
Think about early termination when you only need a small number of matching documents, not full relevance ranking.
✗ Incorrect
Setting "track_scores": false disables scoring calculations, improving performance when relevance scoring is not needed.
🔧 Debug
advanced3:00remaining
Why does this Elasticsearch query cause slow performance?
Consider this query:
{
"query": {
"wildcard": {
"username": "*admin*"
}
}
}
Why might this query be slow on large datasets?
Attempts:
2 left
💡 Hint
Leading wildcards are known to be expensive in search engines.
✗ Incorrect
Wildcard queries starting with * require scanning many terms, causing slow queries on large indexes.
📝 Syntax
advanced2:30remaining
Which option correctly limits search results to documents with a specific field value and sorts by date descending?
Choose the correct Elasticsearch query syntax to filter documents where "status" is "active" and sort results by "created_date" descending.
Attempts:
2 left
💡 Hint
Check the correct use of term query and sort syntax with order key.
✗ Incorrect
Option A uses a term query to filter exact matches and sorts by created_date descending correctly.
🚀 Application
expert4:00remaining
How to optimize a search for a large dataset with frequent updates?
You have an Elasticsearch index with millions of documents that update frequently. You want to optimize search performance while keeping data fresh. Which approach is best?
Attempts:
2 left
💡 Hint
Think about separating indexing and searching to improve performance and freshness.
✗ Incorrect
Using index aliases with separate write and read indices allows frequent refreshes on the write index and stable searching on the read index, balancing freshness and performance.