问题
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