0
0
Elasticsearchquery~10 mins

Match 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 basic match query searching for the word "apple" in the "title" field.

Elasticsearch
{
  "query": {
    "match": {
      "title": [1]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"query"
B"match"
C"apple"
D"title"
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the field name as the value instead of the search term.
Using the word 'match' as the value instead of the search term.
2fill in blank
medium

Complete the code to search for the phrase "quick brown fox" in the "description" field using a match query.

Elasticsearch
{
  "query": {
    "match": {
      "description": [1]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"quick brown fox"
B"description"
C"match"
D"phrase"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the field name as the value instead of the phrase.
Using the word 'phrase' as the value.
3fill in blank
hard

Fix the error in the match query to correctly search for "banana" in the "content" field.

Elasticsearch
{
  "query": {
    "match": {
      "content": [1]
    }
  }
}
Drag options to blanks, or click blank then click option'
Abanana
B"banana"
C"content"
Dcontent
Attempts:
3 left
💡 Hint
Common Mistakes
Not putting the search term in quotes causes a syntax error.
Using the field name as the value.
4fill in blank
hard

Fill both blanks to create a match query that searches for "red apple" in the "title" field with operator "and".

Elasticsearch
{
  "query": {
    "match": {
      [1]: {
        "query": [2],
        "operator": "and"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"title"
B"red apple"
C"description"
D"or"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong field name.
Not putting the phrase in quotes.
5fill in blank
hard

Fill all three blanks to create a match query that searches for "fast car" in the "summary" field with operator "or".

Elasticsearch
{
  "query": {
    "match": {
      [1]: {
        "query": [2],
        "operator": [3]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A"summary"
B"fast car"
C"or"
D"and"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong operator.
Not quoting the phrase or operator.