Challenge - 5 Problems
Match Phrase Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Match phrase query exact phrase search
What is the output of this Elasticsearch match_phrase query when searching for the phrase "quick brown fox" in the
content field?Elasticsearch
{
"query": {
"match_phrase": {
"content": "quick brown fox"
}
}
}Attempts:
2 left
💡 Hint
Match phrase queries look for the exact sequence of words in the given order.
✗ Incorrect
The match_phrase query searches for the exact phrase as a sequence of words in the specified field. It does not match individual words separately or out of order.
🧠 Conceptual
intermediate1:30remaining
Understanding slop in match_phrase query
In an Elasticsearch match_phrase query, what does the
slop parameter control?Attempts:
2 left
💡 Hint
Think about how flexible the phrase matching is regarding word order and distance.
✗ Incorrect
The slop parameter allows words in the phrase to be separated by a certain number of other words or to appear out of order within that distance, enabling fuzzy phrase matching.
🔧 Debug
advanced2:30remaining
Why does this match_phrase query return no results?
Given this query searching for the phrase
"fast fox" in the description field, why might it return no results even though documents contain the words "fast" and "fox"?Elasticsearch
{
"query": {
"match_phrase": {
"description": "fast fox"
}
}
}Attempts:
2 left
💡 Hint
Match phrase requires the exact sequence of words.
✗ Incorrect
Match phrase queries require the exact phrase to appear in the specified order. If the words appear separately or in a different order, no match is found.
📝 Syntax
advanced2:00remaining
Identify the syntax error in this match_phrase query
Which option contains the correct syntax for a match_phrase query searching for "data science" in the
summary field?Attempts:
2 left
💡 Hint
Check the correct structure for match_phrase with a query string.
✗ Incorrect
A correct syntax for match_phrase is the field name mapped to an object with a "query" key holding the phrase string.
🚀 Application
expert3:00remaining
Using slop to find near matches with match_phrase
You want to find documents where the phrase "machine learning" appears but allow up to 2 words between "machine" and "learning". Which query achieves this?
Attempts:
2 left
💡 Hint
Slop must be inside the match_phrase field object with the query string.
✗ Incorrect
The slop parameter must be inside the object for the field in the match_phrase query, alongside the query string.