0
0
Elasticsearchquery~10 mins

Match phrase query 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 create a match_phrase query searching for "quick brown" in the "message" field.

Elasticsearch
{
  "query": {
    "match_phrase": {
      "message": [1]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"quick brown"
B"quick"
C"brown"
D"quick brown fox"
Attempts:
3 left
💡 Hint
Common Mistakes
Using only one word instead of the full phrase.
Not putting the phrase inside quotes.
2fill in blank
medium

Complete the code to add a slop of 2 to the match_phrase query for "quick fox" in the "message" field.

Elasticsearch
{
  "query": {
    "match_phrase": {
      "message": {
        "query": "quick fox",
        "[1]": 2
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aboost
Bfuzziness
Cslop
Danalyzer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'boost' instead of 'slop'.
Confusing 'fuzziness' with 'slop'.
3fill in blank
hard

Fix the error in the match_phrase query by completing the missing key for the phrase "lazy dog" in the "content" field.

Elasticsearch
{
  "query": {
    "match_phrase": {
      "content": {
        [1]: "lazy dog"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"phrase"
B"match"
C"text"
D"query"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'phrase' or 'match' instead of 'query'.
Omitting the key and just putting the string.
4fill in blank
hard

Fill both blanks to create a match_phrase query on the "title" field with phrase "open source" and slop 1.

Elasticsearch
{
  "query": {
    "match_phrase": {
      "title": {
        "[1]": "open source",
        "[2]": 1
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aquery
Bslop
Cboost
Danalyzer
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping 'boost' or 'analyzer' for 'slop'.
Using 'phrase' instead of 'query'.
5fill in blank
hard

Fill all three blanks to create a match_phrase query on the "description" field with phrase "fast car", slop 3, and boost 2.0.

Elasticsearch
{
  "query": {
    "match_phrase": {
      "description": {
        "[1]": "fast car",
        "[2]": 3,
        "[3]": 2.0
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aquery
Bslop
Cboost
Danalyzer
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'boost' and 'slop' keys.
Using 'analyzer' instead of 'boost'.