
Originally Posted by
busboy
I am familiar with using like by itself...
there is only one way to use LIKE
Code:
SELECT tID
, DATE_FORMAT(date,'%m-%d-%Y') as date
, viewed
, summary
, CASE WHEN summary LIKE '%eye%' THEN 1 ELSE 0 END +
CASE WHEN testimony LIKE '%eye%' THEN 1 ELSE 0 END +
CASE WHEN keywords LIKE '%eye%' THEN 1 ELSE 0 END AS score
FROM testimonies
WHERE approved = 'Yes'
AND ( summary LIKE '%eye%'
OR testimony LIKE '%eye%'
OR keywords LIKE '%eye%' )
ORDER
BY score DESC LIMIT 50;
you could run this whenever the user's search term is a single word of less than 4 cfharacters, and continue to use the MATCH query for other search terms
Bookmarks