0
0
Elasticsearchquery~10 mins

Synonym handling 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 synonym filter named "synonym_filter".

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "synonym_filter": {
          "type": "[1]",
          "synonyms": ["quick,fast"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asynonym
Bstop
Ckeyword_marker
Dlowercase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' or 'lowercase' as the filter type instead of 'synonym'.
2fill in blank
medium

Complete the analyzer definition to use the synonym filter.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "synonym_analyzer": {
          "tokenizer": "standard",
          "filter": ["lowercase", "[1]"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aasciifolding
Bsynonym_filter
Ckeyword_filter
Dstop_filter
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filter name that does not exist or is unrelated to synonyms.
3fill in blank
hard

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

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "my_synonym_filter": {
          "type": "synonym",
          "synonyms_path": "[1]"
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asynonyms.txt
B/etc/elasticsearch/synonyms.txt
Csynonym.txt
D/usr/local/synonyms.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using absolute paths that Elasticsearch cannot access.
4fill in blank
hard

Fill both blanks to create a synonym filter that expands synonyms and ignore case.

Elasticsearch
{
  "settings": {
    "analysis": {
      "filter": {
        "expanded_synonym": {
          "type": "[1]",
          "expand": [2],
          "synonyms": ["car, automobile"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asynonym
Btrue
Cfalse
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' as filter type or setting expand to false when expansion is needed.
5fill in blank
hard

Fill all three blanks to define an analyzer that uses the synonym filter, lowercase filter, and standard tokenizer.

Elasticsearch
{
  "settings": {
    "analysis": {
      "analyzer": {
        "custom_synonym_analyzer": {
          "tokenizer": "[1]",
          "filter": ["[2]", "[3]"]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astandard
Blowercase
Csynonym_filter
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using stop filter instead of synonym filter or wrong tokenizer.