0
0
Elasticsearchquery~10 mins

Fuzzy matching 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 perform a fuzzy match on the field "name" with the value "Jon".

Elasticsearch
{
  "query": {
    "fuzzy": {
      "name": {
        "value": "[1]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
AJane
BJohn
CJon
DJoan
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different name than the intended search term.
Leaving the value empty or misspelled.
2fill in blank
medium

Complete the code to set the fuzziness level to 2 in the fuzzy query.

Elasticsearch
{
  "query": {
    "fuzzy": {
      "name": {
        "value": "Jon",
        "fuzziness": [1]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"AUTO"
B3
C"1"
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers which makes them strings.
Using an unsupported fuzziness value.
3fill in blank
hard

Fix the error in the fuzzy query by completing the missing key for the search term.

Elasticsearch
{
  "query": {
    "fuzzy": {
      "name": {
        [1]: "Jon",
        "fuzziness": 1
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"value"
B"term"
C"query"
D"match"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect keys like "term" or "match" inside the fuzzy query.
Omitting the key and only providing the value.
4fill in blank
hard

Fill both blanks to create a fuzzy query that searches the "title" field for "elastic" with fuzziness 1.

Elasticsearch
{
  "query": {
    "fuzzy": {
      [1]: {
        "value": [2],
        "fuzziness": 1
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"title"
B"elastic"
C"name"
D"elasticsearch"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up field names and values.
Not quoting the strings properly.
5fill in blank
hard

Fill all three blanks to create a fuzzy query on the "description" field with value "search", fuzziness "AUTO", and prefix length 2.

Elasticsearch
{
  "query": {
    "fuzzy": {
      [1]: {
        "value": [2],
        "fuzziness": [3],
        "prefix_length": 2
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"description"
B"search"
C"AUTO"
D"searching"
Attempts:
3 left
💡 Hint
Common Mistakes
Using numeric fuzziness instead of "AUTO" when asked.
Forgetting to quote string values.
Confusing prefix_length with fuzziness.