Challenge - 5 Problems
Edge N-Gram 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 edge n-gram tokenizer example?
Given the following Elasticsearch analyzer configuration using edge n-gram tokenizer, what tokens will be generated for the input text
"search"?Elasticsearch
{
"settings": {
"analysis": {
"tokenizer": {
"edge_ngram_tokenizer": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 4,
"token_chars": ["letter"]
}
},
"analyzer": {
"edge_ngram_analyzer": {
"tokenizer": "edge_ngram_tokenizer"
}
}
}
}
}Attempts:
2 left
💡 Hint
Edge n-gram tokenizer generates tokens starting from the beginning of the word with lengths between min_gram and max_gram.
✗ Incorrect
The edge n-gram tokenizer with min_gram=2 and max_gram=4 generates tokens starting from the first character with lengths 2, 3, and 4. For 'search', these are 'se', 'sea', and 'sear'.
🧠 Conceptual
intermediate1:30remaining
Which option best describes the purpose of edge n-gram tokenizer in autocomplete?
What is the main reason to use an edge n-gram tokenizer in an autocomplete feature?
Attempts:
2 left
💡 Hint
Think about how autocomplete suggests words as you type from the start.
✗ Incorrect
Edge n-gram tokenizer creates tokens starting from the beginning of words, which helps match user input prefixes efficiently in autocomplete.
🔧 Debug
advanced2:00remaining
Why does this edge n-gram analyzer not produce any tokens?
Given this analyzer configuration, why does the input text
"hello" produce no tokens?Elasticsearch
{
"settings": {
"analysis": {
"tokenizer": {
"my_edge_ngram": {
"type": "edge_ngram",
"min_gram": 3,
"max_gram": 5,
"token_chars": ["digit"]
}
},
"analyzer": {
"my_analyzer": {
"tokenizer": "my_edge_ngram"
}
}
}
}
}Attempts:
2 left
💡 Hint
Check the token_chars setting and the input text characters.
✗ Incorrect
The tokenizer only creates tokens from characters classified as digits, but the input 'hello' contains only letters, so no tokens are generated.
📝 Syntax
advanced1:30remaining
Which option correctly defines an edge n-gram tokenizer with min_gram 1 and max_gram 3?
Select the valid Elasticsearch tokenizer configuration for edge n-gram with min_gram 1 and max_gram 3.
Attempts:
2 left
💡 Hint
Check the correct property names and value types for edge n-gram tokenizer.
✗ Incorrect
The correct property names are 'min_gram' and 'max_gram' with integer values. The type is 'edge_ngram' all lowercase with underscore.
🚀 Application
expert2:00remaining
How many tokens are generated by this edge n-gram tokenizer for input 'data'?
Given this tokenizer configuration, how many tokens will be generated for the input text
"data"?
{
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 3,
"token_chars": ["letter"]
}Attempts:
2 left
💡 Hint
Count tokens starting from the first letter with lengths 1 to 3.
✗ Incorrect
Tokens generated are 'd' (length 1), 'da' (length 2), and 'dat' (length 3), totaling 3 tokens.