0
0
Elasticsearchquery~20 mins

Token filters (lowercase, stemmer, synonym) in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Token Filter 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 Elasticsearch analyzer test?
Given the following analyzer configuration and input text, what tokens will be produced after applying the lowercase and stemmer filters?
Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "standard",
          "filter": ["lowercase", "english_stemmer"]
        }
      },
      "filter": {
        "english_stemmer": {
          "type": "stemmer",
          "language": "english"
        }
      }
    }
  }
}

Input text: "Running runners run quickly"
A["run", "run", "run", "quickli"]
B["run", "runner", "run", "quickli"]
C["running", "runners", "run", "quickly"]
D["running", "runner", "run", "quick"]
Attempts:
2 left
💡 Hint
Remember that the lowercase filter converts all tokens to lowercase before stemming. The stemmer reduces words to their root form.
🧠 Conceptual
intermediate
1:00remaining
Which token filter is responsible for replacing words with their synonyms?
In Elasticsearch, which token filter should you use to replace tokens with their synonyms during analysis?
Asynonym
Bstop
Cstemmer
Dlowercase
Attempts:
2 left
💡 Hint
Think about the filter that changes words to other words with similar meaning.
🔧 Debug
advanced
2:00remaining
Why does this synonym filter configuration cause an error?
Examine the following synonym filter configuration. Why does Elasticsearch reject it with a syntax error?
Elasticsearch
{
  "filter": {
    "my_synonym": {
      "type": "synonym",
      "synonyms": [
        "quick, fast",
        "jumps, leap"
      ]
    }
  }
}
AThe synonyms list must be a file path, not an inline array.
BThe filter type 'synonym' is deprecated and must be 'synonym_graph'.
CThe synonym filter requires a 'synonyms_path' property instead of 'synonyms'.
DThe synonyms must be separated by '=>' instead of commas.
Attempts:
2 left
💡 Hint
Check the latest Elasticsearch documentation for synonym filter types.
📝 Syntax
advanced
1:30remaining
Which option correctly defines a lowercase token filter in Elasticsearch?
Select the correct JSON snippet that defines a lowercase token filter named 'my_lowercase'.
A{ "filter": { "my_lowercase": { "type": "LowerCase" } } }
B{ "filter": { "my_lowercase": { "type": "lower_case" } } }
C{ "filters": { "my_lowercase": { "type": "lowercase" } } }
D{ "filter": { "my_lowercase": { "type": "lowercase" } } }
Attempts:
2 left
💡 Hint
Check the exact spelling and case sensitivity of the 'type' property.
🚀 Application
expert
2:30remaining
How many tokens are produced by this analyzer with synonym and lowercase filters?
Given this analyzer configuration and input, how many tokens will be produced?
Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "syn_lower_analyzer": {
          "tokenizer": "standard",
          "filter": ["lowercase", "my_synonym"]
        }
      },
      "filter": {
        "my_synonym": {
          "type": "synonym_graph",
          "synonyms": [
            "quick, fast",
            "jumps, leaps"
          ]
        }
      }
    }
  }
}

Input text: "The quick fox jumps"
A4
B5
C6
D7
Attempts:
2 left
💡 Hint
Remember that synonym_graph can produce multiple tokens for synonyms, increasing token count.