mysql 5.0 upgrade to 5.1 Match function

≡放荡痞女 提交于 2019-12-25 07:48:10

问题


I migrated a website's database from MySQL 5.0.95 to MySQL 5.1.59

When i try to do a search i get different results
for example: When i search for "MTH" on the old database i get one result, but when i search on the new database for "MTH" i do not get any results

However when i do a search for "accountents" i DO get the SAME results with both databases!?! so only some words shows different results, not all

I narrowed it down to the "match" function from mysql. Anyone who has had the same problem wen migrating a website perhaps?

This is my sql query:

SELECT
 a.addressid,
 a.status,
 a.name,
 a.subname,
 a.subtitle,
 a.city,
 a.googlemaps,
 a.address,
 a.zipcode,
 a.pobox,
 a.poboxzipcode,
 a.phone,
 a.fax,
 a.website,
 a.intro,
 a.packageid_fk,
 a.enddate,
 DATE_FORMAT(a.enddatenew, '%d-%m-%Y') AS endingdate,
 p.name package,
 m.themeid_fk
FROM
 addresses AS a

INNER JOIN addresses_subcategories AS a_s 
 ON a_s.addressid_fk = a.addressid
LEFT  JOIN packages                AS p   
 ON p.packageid      = a.packageid_fk
INNER JOIN subcategories  AS s 
 ON s.subcategoryid  = a_s.subcategoryid_fk
INNER JOIN maincategories AS m 
 ON m.maincategoryid = s.maincategoryid_fk
WHERE
 a.status = 1
AND 
MATCH(a.name, a.subname, a.sponsorkeywords, a.extrakeywords, a.website)
AGAINST('MTH*' IN BOOLEAN MODE)
AND
a.websiteid_fk = 1

GROUP BY a.addressid
ORDER BY a.packageid_fk DESC, a.sort ASC, a.name ASC

PS. This very same query works great on MySQL 5.0, however on 5.1 it does not show the same results


回答1:


Seems it had to do with the ft_min_word_len variable. after contacting my webhost they changed it and now it words again



来源:https://stackoverflow.com/questions/21556823/mysql-5-0-upgrade-to-5-1-match-function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!