SQL Query doesn't work in newer MySQL version

时间:2015-11-12 11:12:15

标签: mysql sql

I have a query that works fine on MySQL 5.0.45 and returns 4 rows, but returns no rows on MySQ 5.5.37.

Query:

SELECT id, MATCH (name, fb_title, fb_desc) AGAINST ('ic3') as score
FROM (`pages`)
WHERE `published` =  1
AND MATCH (name, fb_title, fb_desc) AGAINST ('ic3')
AND `section_id` IN (9, 1, 2, 3, 118, 8, 375, 119, 378, 120, 121, 320, 321, 4, 5, 6, 7, 204, 179, 205, 178) 
ORDER BY `score` DESC

I feel it could be to do with MATCH, but I'm unsure.

Thanks

1 个答案:

答案 0 :(得分:2)

You are searching for the string 'ic3', which is 3 characters long. The default value for minimum fulltext word search is 4 in mysql v5.5. You should change this value to 3 and rebuild all fulltext indexes.