Query Expansion
With WITH QUERY EXPANSION, MySQL performs a second search using words from the top results of the first — broadening the result set to related topics.
With WITH QUERY EXPANSION, MySQL performs a second search using words from the top results of the first — broadening the result set to related topics.
SELECT title
FROM articles
WHERE MATCH(title, body)
AGAINST('database' WITH QUERY EXPANSION)
LIMIT 20;
-- MySQL first finds "database" articles,
-- then expands using words from those top results
Query expansion works best on large datasets — avoid on small tables where it over-expands.