Bird
0
0

Given this Elasticsearch query snippet, what will the highlight section return for a match in the title field?

medium📝 Predict Output Q13 of 15
Elasticsearch - Search Results and Scoring
Given this Elasticsearch query snippet, what will the highlight section return for a match in the title field?
{
  "query": {"match": {"title": "quick fox"}},
  "highlight": {"fields": {"title": {}}}
}
AAn error because highlight requires custom tags
BOnly the word "quick" highlighted, "fox" ignored
CThe matched words "quick" and "fox" wrapped in default highlight tags
DNo highlighting because tags are missing
Step-by-Step Solution
Solution:
  1. Step 1: Understand default highlight behavior

    When highlight is enabled with empty options, Elasticsearch wraps matched words with default tags like <em> and </em>.
  2. Step 2: Analyze the query

    The query matches both "quick" and "fox" in the title, so both words will be highlighted.
  3. Final Answer:

    The matched words "quick" and "fox" wrapped in default highlight tags -> Option C
  4. Quick Check:

    Default highlight tags wrap matched words [OK]
Quick Trick: Empty highlight options use default tags to wrap matches [OK]
Common Mistakes:
MISTAKES
  • Thinking highlight needs custom tags to work
  • Assuming only first matched word is highlighted
  • Believing missing tags cause errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes