Bird
0
0

Why does ts_headline sometimes highlight words that are not exact matches to the query terms?

hard📝 Conceptual Q10 of 15
PostgreSQL - Full-Text Search
Why does ts_headline sometimes highlight words that are not exact matches to the query terms?
ABecause it highlights all words in the text by default.
BBecause it uses stemming and normalization in text search.
CBecause the query is case sensitive and matches partial words.
DBecause ts_headline ignores the tsquery argument.
Step-by-Step Solution
Solution:
  1. Step 1: Understand text search behavior

    PostgreSQL text search uses stemming to match word roots, not exact words.
  2. Step 2: Explain why non-exact matches highlight

    Stemming causes related word forms to be matched and highlighted.
  3. Final Answer:

    Because it uses stemming and normalization in text search. -> Option B
  4. Quick Check:

    Stemming causes related words to highlight [OK]
Quick Trick: Stemming causes related words to highlight [OK]
Common Mistakes:
  • Assuming exact word match only
  • Thinking ts_headline highlights all words
  • Ignoring stemming effects

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes