limiting full text mysql searches to exact matches

a 夏天 提交于 2019-12-11 09:47:35

问题


I am trying to match a table with keywords against a text. Problem is, that the query does not return exact matches, but only the most relevant ones:

    SELECT name, name_safe, MATCH name AGAINST ('".$ad['text']."') as importance
    FROM $T2
    WHERE MATCH name AGAINST ('".$ad['text']."') AND cat_type = 4
    ORDER BY importance DESC
    LIMIT 1

$T2 contains keywords like

hunde welpen
chihuahua

I only want the query to return a hit if it is an exact match. So a search for "welpen" should not return a result.

Thank you for any help.

来源:https://stackoverflow.com/questions/25219868/limiting-full-text-mysql-searches-to-exact-matches

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