我有搜索功能,可以在大型 mysql 表中搜索关键字,但由于我需要过滤掉所有坏词,我必须在 MySQL 中进行以下类型的 AND 比较,这是一长串禁用词(超过 500+),因此它非常慢,
SELECT * FROM keywords WHERE 1
AND keyword NOT LIKE '%love%'
AND keyword NOT LIKE '%hope%'
AND keyword NOT LIKE '%caring%'
AND keyword NOT LIKE '%x%'
AND keyword NOT LIKE '%happiness%'
AND keyword NOT LIKE '%forgiveness%'
AND keyword NOT LIKE '%good%'
AND keyword NOT LIKE '%great%'
AND keyword NOT LIKE '%positive%'
AND keyword NOT LIKE '%sharing%'
AND keyword NOT LIKE '%awesome%'
AND keyword NOT LIKE '%fantastic%'
还有其他更好的方法吗?