PHP + MYSQL multi-keyword + fuzzy search + matching sorting. how can this problem be achieved? I have already used MYSQL & nbsp; UNION & nbsp; to achieve one, but the efficiency is too low. please ask the top guys on the forum if there is a better way. Mysqlphp fuzzy search PHP + MYSQL multi-keyword + fuzzy search + matching sorting. how can this problem be achieved?
Mysql union has been used to implement one, but the efficiency is too low. please ask the experts on the forum if there is a better way.
Mysql php fuzzy search sorting
------ Solution --------------------
Since you do not need to calculate the number of occurrences, the combination is not better.
SELECT. 'askid',. 'catid',. 'title',. 'status',. 'addtime',. 'reward ',. 'ancercount', B. 'message'
FROM 'phpcms _ ask 'a left join 'phpcms _ ask_posts 'B ON a. 'askid' = B. 'askid'
WHERE (. status = 3 OR. status = 5) AND B. 'isask '= 1 AND (LOCATE ('China',. 'title')> 0 or locate ('Beijing',. 'title')> 0 or locate ('Tiananmen Square ',. 'title')> 0)
------ Solution --------------------
To calculate the matching degree, you only need
Select sign (LOCATE ('China',. 'title') + sign (LOCATE ('Beijing',. 'title') + sign (LOCATE ('Tiananmen Square ',. 'title') as matching number from...