MySql Full text Search

三世轮回 提交于 2019-12-24 22:12:23

问题


In my Job listings site, I need to show jobs which have similar titles to the one which is being viewed. I am trying the following query, but its not working:

SELECT  *, 
MATCH(title) AGAINST "Sales Coordinator" as relevance
FROM
  jobs
WHERE
  MATCH(title) AGAINST "Sales Coordinator"
ORDER BY relevance DESC
LIMIT 100

Also, can this be optimized, so as to give better results and maybe faster too?


回答1:


You really need to clarify what is not working (i.e. what is it not finding) and how fast the current is. I assume you created a full text index on the "title" field?

You might be looking for the "IN BOOLEAN MODE" option.

MATCH(title) AGAINST ("Sales* Coordinator*" IN BOOLEAN MODE)

That would find things like "salesman".



来源:https://stackoverflow.com/questions/3219058/mysql-full-text-search

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