0
0
Elasticsearchquery~10 mins

Token filters (lowercase, stemmer, synonym) in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a lowercase token filter in the analyzer.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "standard",
          "filter": ["[1]"]
        }
      },
      "filter": {
        "lowercase_filter": {
          "type": "lowercase"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asynonym_filter
Bstemmer_filter
Clowercase_filter
Dstop_filter
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filter name that is not defined in the filter section.
Confusing filter names like stemmer or synonym instead of lowercase.
2fill in blank
medium

Complete the code to add a stemmer token filter named "english_stemmer".

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "english_stemmer": {
          "type": "[1]",
          "language": "english"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astemmer
Blowercase
Cstop
Dsynonym
Attempts:
3 left
💡 Hint
Common Mistakes
Using "stemmer_filter" instead of "stemmer" as the type.
Confusing stemmer with synonym or lowercase types.
3fill in blank
hard

Fix the error in the synonym filter definition by completing the missing type.

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "my_synonym_filter": {
          "type": "[1]",
          "synonyms": [
            "quick,fast",
            "jumps,leaps"
          ]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asynonym
Bstemmer
Clowercase
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using "synonym_filter" instead of "synonym" as the type.
Confusing synonym filter type with stemmer or lowercase.
4fill in blank
hard

Fill both blanks to create an analyzer that uses the standard tokenizer and applies lowercase and stemmer filters.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "custom_analyzer": {
          "tokenizer": "[1]",
          "filter": ["lowercase_filter", "[2]"]
        }
      },
      "filter": {
        "lowercase_filter": {
          "type": "lowercase"
        },
        "english_stemmer": {
          "type": "stemmer",
          "language": "english"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astandard
Benglish_stemmer
Ckeyword
Dsynonym_filter
Attempts:
3 left
💡 Hint
Common Mistakes
Using "keyword" tokenizer instead of "standard".
Using filter names not defined in the filter section.
5fill in blank
hard

Fill all three blanks to define a synonym filter and use it in an analyzer with lowercase and standard tokenizer.

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "my_synonym_filter": {
          "type": "[1]",
          "synonyms": ["fast,quick", "jumps,leaps"]
        }
      },
      "analyzer": {
        "synonym_analyzer": {
          "tokenizer": "[2]",
          "filter": ["[3]", "my_synonym_filter"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asynonym
Bstandard
Clowercase
Dstemmer
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect filter types like "stemmer" for synonyms.
Placing filters in wrong order or using undefined filters.