in order to sort by a column, you should put that column into the SELECT clause
Code:
SELECT *
FROM (
SELECT bible.*
, CASE WHEN text_data LIKE '%there%'
THEN 1 ELSE 0 END
+ CASE WHEN text_data LIKE '%house%'
THEN 1 ELSE 0 END
+ CASE WHEN text_data LIKE '%daughter%'
THEN 1 ELSE 0 END
AS relevance
FROM bible
WHERE text_data LIKE '%there%'
OR text_data LIKE '%house%'
OR text_data LIKE '%daughter%'
) AS d
WHERE relevance > 4
ORDER
BY relevance
by the way, it's going to be pretty difficult to reach a score greater than 4 if you're only scoring up to 3 keywords
