Complete the code to create a basic match query searching for the word "apple" in the "title" field.
{
"query": {
"match": {
"title": [1]
}
}
}The match query requires the search term as the value for the field. Here, "apple" is the search term for the "title" field.
Complete the code to search for the phrase "quick brown fox" in the "description" field using a match query.
{
"query": {
"match": {
"description": [1]
}
}
}The match query value is the phrase you want to search for in the specified field.
Fix the error in the match query to correctly search for "banana" in the "content" field.
{
"query": {
"match": {
"content": [1]
}
}
}The search term must be a string, so it needs to be inside quotes.
Fill both blanks to create a match query that searches for "red apple" in the "title" field with operator "and".
{
"query": {
"match": {
[1]: {
"query": [2],
"operator": "and"
}
}
}
}The field name is "title" and the query string is "red apple". The operator "and" means all words must match.
Fill all three blanks to create a match query that searches for "fast car" in the "summary" field with operator "or".
{
"query": {
"match": {
[1]: {
"query": [2],
"operator": [3]
}
}
}
}The field is "summary", the query is "fast car", and the operator "or" means any word can match.