What is full-text search and how does it differ from LIKE queries?
Answer
LIKE '%keyword%' does a substring scan — it cannot use indexes (leading wildcard disables index usage), is case-sensitive by default, and has no relevance ranking. Full-text search builds an inverted index mapping each word to the rows containing it — searches are O(log n) instead of O(n), support stemming ("run" matches "running"), stop word removal, synonym matching, and relevance ranking (TF-IDF). PostgreSQL full-text search: to_tsvector('english', body) @@ to_tsquery('search & terms'). MySQL: MATCH(col) AGAINST ('term'). For advanced needs, dedicated engines like Elasticsearch or Meilisearch offer richer features (fuzzy matching, faceted search, multi-language).
Previous
What is a database cursor and when should you use one?
Next
What is database CDC (Change Data Capture)?