MySQL与2个或更多关键字匹配

时间:2017-01-08 06:31:09

标签: mysql

我有这个mysql查询

SELECT * FROM object_data WHERE MATCH(
object_data.personal_info, 
object_data.experience, 
object_data.position_preferred
) AGAINST ('Building Hotel' IN BOOLEAN MODE)

你看我有#34;建筑酒店"。我想搜索buildinghotel,无论它们是什么列,只要它们连续存在。我的查询会发生什么,它列出了至少有一个关键字的所有行。

与此类似:

columnName = "Building" AND columnName = "Hotel"

有什么建议吗?

1 个答案:

答案 0 :(得分:1)

试试这个

SELECT MATCH(object_data.personal_info, object_data.experience,object_data.position_preferred) AGAINST ('Building
Hotel') as Relevance FROM object_data WHERE MATCH
('Building
Hotel') AGAINST('+Building +Hotel' IN 
BOOLEAN MODE) HAVING Relevance > 0.2 ORDER 
BY Relevance DESC