Complete the code to create a match_phrase query searching for "quick brown" in the "message" field.
{
"query": {
"match_phrase": {
"message": [1]
}
}
}The match_phrase query requires the exact phrase as a string value. Here, "quick brown" is the phrase to match.
Complete the code to add a slop of 2 to the match_phrase query for "quick fox" in the "message" field.
{
"query": {
"match_phrase": {
"message": {
"query": "quick fox",
"[1]": 2
}
}
}
}The slop parameter allows matching phrases with words in between, controlling how far apart the words can be.
Fix the error in the match_phrase query by completing the missing key for the phrase "lazy dog" in the "content" field.
{
"query": {
"match_phrase": {
"content": {
[1]: "lazy dog"
}
}
}
}The key query is required to specify the phrase string inside the match_phrase query object.
Fill both blanks to create a match_phrase query on the "title" field with phrase "open source" and slop 1.
{
"query": {
"match_phrase": {
"title": {
"[1]": "open source",
"[2]": 1
}
}
}
}The query key holds the phrase string, and slop controls the allowed distance between words.
Fill all three blanks to create a match_phrase query on the "description" field with phrase "fast car", slop 3, and boost 2.0.
{
"query": {
"match_phrase": {
"description": {
"[1]": "fast car",
"[2]": 3,
"[3]": 2.0
}
}
}
}The keys query, slop, and boost specify the phrase, allowed word distance, and importance weight respectively.