0
0
Elasticsearchquery~10 mins

Completion suggester 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 completion suggester in the search query.

Elasticsearch
{
  "suggest": {
    "song-suggest": {
      "prefix": "nirv",
      "completion": {
        "field": "[1]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Atitle
Btitle_suggest
Csuggest
Dsuggest_field
Attempts:
3 left
💡 Hint
Common Mistakes
Using the suggester name instead of the field name.
Using a field that is not mapped as a completion field.
2fill in blank
medium

Complete the code to add a size limit to the number of suggestions returned.

Elasticsearch
{
  "suggest": {
    "song-suggest": {
      "prefix": "nirv",
      "completion": {
        "field": "title",
        "[1]": 5
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Asize
Bmax_suggestions
Climit
Dmax_results
Attempts:
3 left
💡 Hint
Common Mistakes
Using limit or max_results which are not valid parameters here.
Using max_suggestions which does not exist.
3fill in blank
hard

Fix the error in the completion suggester query by completing the missing parameter.

Elasticsearch
{
  "suggest": {
    "song-suggest": {
      "prefix": "nirv",
      "completion": {
        "field": "title",
        "skip_duplicates": [1]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"true"
B"false"
Ctrue
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Putting boolean values in quotes, making them strings.
Using capitalized True which is Python style, not JSON.
4fill in blank
hard

Fill both blanks to create a completion suggester with fuzzy matching enabled and a fuzziness level of 2.

Elasticsearch
{
  "suggest": {
    "song-suggest": {
      "prefix": "nirv",
      "completion": {
        "field": "title",
        "[1]": {
          "fuzziness": [2]
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Afuzzy
Bfuzziness
C2
D"2"
Attempts:
3 left
💡 Hint
Common Mistakes
Using fuzziness as the first blank instead of fuzzy.
Putting fuzziness level in quotes.
5fill in blank
hard

Fill all three blanks to create a completion suggester that uses the prefix "nirv", returns 3 suggestions, and skips duplicates.

Elasticsearch
{
  "suggest": {
    "song-suggest": {
      "prefix": "[1]",
      "completion": {
        "field": "title",
        "size": [2],
        "skip_duplicates": [3]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Anirv
B3
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using skip_duplicates as a string instead of boolean.
Setting size to a string instead of a number.