0
0
Elasticsearchquery~10 mins

Why text analysis enables smart search in Elasticsearch - Test Your Understanding

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

Complete the code to define a basic analyzer that lowercases text.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_lowercase_analyzer": {
          "type": "[1]"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asimple
Bstandard
Ckeyword
Dcustom
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'keyword' analyzer which does not lowercase text.
Using 'standard' analyzer which does more than just lowercase.
2fill in blank
medium

Complete the code to add a stopwords filter to remove common words.

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "my_stop": {
          "type": "[1]",
          "stopwords": ["the", "is", "at"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astop
Blowercase
Csynonym
Dstemmer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'lowercase' filter which only changes case.
Using 'stemmer' which reduces words to their root form.
3fill in blank
hard

Fix the error in the analyzer definition to include both lowercase and stop filters.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": ["[1]", "stop"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astemmer
Bkeyword
Csynonym
Dlowercase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stemmer' which changes word forms instead of case.
Using 'keyword' which does not change tokens.
4fill in blank
hard

Fill both blanks to create a mapping that uses the custom analyzer and enables full-text search.

Elasticsearch
{
  "mappings": {
    "properties": {
      "content": {
        "type": "[1]",
        "analyzer": "[2]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Atext
Bkeyword
Cmy_analyzer
Dstandard
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'keyword' type which does not analyze text.
Using 'standard' analyzer instead of the custom one.
5fill in blank
hard

Fill all three blanks to define a custom analyzer with a standard tokenizer, lowercase and stop filters.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "custom_text_analyzer": {
          "type": "[1]",
          "tokenizer": "[2]",
          "filter": ["[3]", "stop"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Acustom
Bstandard
Clowercase
Dkeyword
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'keyword' tokenizer which does not split text.
Omitting the lowercase filter.