0
0
Elasticsearchquery~10 mins

Phrase suggestions (did you mean) 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 add a phrase suggestion named "my-suggestion" to the search query.

Elasticsearch
{
  "suggest": {
    "my-suggestion": {
      "phrase": {
        "field": [1]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"content"
B"title"
C"message"
D"author"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a field name that does not exist in the index.
Forgetting to put the field name in quotes.
2fill in blank
medium

Complete the code to set the size of phrase suggestions to 3.

Elasticsearch
{
  "suggest": {
    "my-suggestion": {
      "phrase": {
        "field": "message",
        "size": [1]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A3
B1
C5
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Setting size to 0 or a negative number.
Using a string instead of a number.
3fill in blank
hard

Fix the error in the phrase suggestion by completing the code with the correct "text" parameter.

Elasticsearch
{
  "suggest": {
    "my-suggestion": {
      "text": [1],
      "phrase": {
        "field": "message"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Ahelo wrld
B"helo wrld"
C"hello world"
Dhello world
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the text string.
Using correct spelling instead of the misspelled text.
4fill in blank
hard

Fill both blanks to add a "direct_generator" with "suggest_mode" set to "always" inside the phrase suggestion.

Elasticsearch
{
  "suggest": {
    "my-suggestion": {
      "text": "helo wrld",
      "phrase": {
        "field": "message",
        "direct_generator": [
          {
            "suggest_mode": [1]
          }
        ]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"always"
B"popular"
C"missing"
D"never"
Attempts:
3 left
💡 Hint
Common Mistakes
Using suggest_mode values not supported by Elasticsearch.
Omitting quotes around the suggest_mode value.
5fill in blank
hard

Fill all three blanks to add a phrase suggestion with "text", "field", and "size" parameters correctly set.

Elasticsearch
{
  "suggest": {
    "my-suggestion": {
      "text": [1],
      "phrase": {
        "field": [2],
        "size": [3]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"spel cheker"
B"message"
C2
D"title"
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers in quotes.
Omitting quotes around string values.
Using incorrect field names.