Bird
0
0

Which of the following is the correct syntax for a match_phrase query in Elasticsearch?

easy📝 Syntax Q12 of 15
Elasticsearch - Basic Search Queries
Which of the following is the correct syntax for a match_phrase query in Elasticsearch?
A{ "match": { "field": "search text" } }
B{ "match_phrase": { "field": "search text" } }
C{ "term": { "field": "search text" } }
D{ "range": { "field": { "gte": 10 } } }
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct query type

    The match_phrase query uses the key "match_phrase" with the field and the phrase to search.
  2. Step 2: Check the syntax format

    The correct syntax is a JSON object with "match_phrase" as the key and the field name mapping to the phrase string.
  3. Final Answer:

    { "match_phrase": { "field": "search text" } } -> Option B
  4. Quick Check:

    Correct JSON syntax for match_phrase = { "match_phrase": { "field": "search text" } } [OK]
Quick Trick: Look for "match_phrase" key with field and phrase inside braces [OK]
Common Mistakes:
MISTAKES
  • Using "match" instead of "match_phrase"
  • Confusing with "term" or "range" queries
  • Incorrect JSON structure or missing braces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes