Challenge - 5 Problems
Fuzzy Matching Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Fuzzy query with max_expansions effect
What is the output of this Elasticsearch fuzzy query when searching for the term
"roam" with max_expansions set to 2?Elasticsearch
{
"query": {
"fuzzy": {
"name": {
"value": "roam",
"fuzziness": 1,
"max_expansions": 2
}
}
}
}Attempts:
2 left
💡 Hint
Think about how max_expansions limits the number of fuzzy variations Elasticsearch considers.
✗ Incorrect
The max_expansions parameter limits how many fuzzy variations Elasticsearch will try. Setting it to 2 means it will consider only two possible fuzzy matches like "foam" and "roam". It does not disable fuzziness or cause errors.
🧠 Conceptual
intermediate1:30remaining
Understanding fuzziness parameter
Which statement correctly describes the
fuzziness parameter in Elasticsearch fuzzy queries?Attempts:
2 left
💡 Hint
Fuzziness relates to how different the matched words can be from the query word.
✗ Incorrect
Fuzziness defines the maximum number of single-character edits (insertions, deletions, substitutions) allowed to consider a term a match.
🔧 Debug
advanced2:30remaining
Why does this fuzzy query return no results?
Given this fuzzy query searching for "aple" with fuzziness 1, why does it return no results?
Elasticsearch
{
"query": {
"fuzzy": {
"name": {
"value": "aple",
"fuzziness": 1,
"prefix_length": 3
}
}
}
}Attempts:
2 left
💡 Hint
Check how prefix_length affects which characters must match exactly.
✗ Incorrect
prefix_length 3 means the first 3 characters must be identical. "aple" and "apple" differ at the third character, so no match occurs despite fuzziness.
📝 Syntax
advanced1:30remaining
Identify the syntax error in this fuzzy query
Which option contains the correct syntax for a fuzzy query searching for "color" with fuzziness 2?
Attempts:
2 left
💡 Hint
Remember JSON requires keys and string values to be in double quotes and colons to separate keys and values.
✗ Incorrect
Option D uses correct JSON syntax with quoted keys and values and colons. Options A and D miss quotes on keys, and C uses '=' instead of ':', all invalid JSON.
🚀 Application
expert3:00remaining
Optimizing fuzzy search for typo tolerance in product names
You want to allow fuzzy matching on product names to tolerate up to 2 typos but avoid too many irrelevant matches. Which query configuration best balances fuzziness and performance?
Attempts:
2 left
💡 Hint
Consider how fuzziness, max_expansions, and prefix_length affect match tolerance and query speed.
✗ Incorrect
Option A allows up to 2 typos (fuzziness=2), limits expansions to 50 to avoid performance issues, and requires first character to match exactly (prefix_length=1) to reduce irrelevant matches. Other options either allow too many expansions, too low fuzziness, or too high fuzziness causing poor balance.