0
0
Elasticsearchquery~10 mins

Custom analyzers 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 define a custom analyzer named "my_analyzer" using the "standard" tokenizer.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "[1]"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Akeyword
Bstandard
Cwhitespace
Dsimple
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filter name instead of a tokenizer name.
Choosing a tokenizer that does not split text into words.
2fill in blank
medium

Complete the code to add a lowercase filter to the custom analyzer "my_analyzer".

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": ["[1]"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Alowercase
Buppercase
Casciifolding
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using "uppercase" filter instead of "lowercase".
Forgetting to add the filter array.
3fill in blank
hard

Fix the error in the custom analyzer definition by completing the filter list to include both "lowercase" and "stop" filters.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": ["[1]", "[2]"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astop
Blowercase
Ckeyword
Dasciifolding
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of filters.
Using filters that do not exist or are unrelated.
4fill in blank
hard

Fill both blanks to create a custom analyzer named "folding_analyzer" that uses the "standard" tokenizer and applies both "lowercase" and "asciifolding" filters.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "folding_analyzer": {
          "type": "custom",
          "tokenizer": "[1]",
          "filter": ["[2]", "[3]"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astandard
Blowercase
Casciifolding
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of filters.
Using a tokenizer other than "standard".
5fill in blank
hard

Fill all four blanks to define a custom analyzer "custom_analyzer" with "whitespace" tokenizer and filters "lowercase", "stop", and "asciifolding" in that order.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "custom_analyzer": {
          "type": "custom",
          "tokenizer": "[1]",
          "filter": ["[2]", "[3]", "[4]"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Awhitespace
Blowercase
Cstop
Dasciifolding
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong tokenizer.
Incorrect order of filters.
Missing one of the filters.