我有一个包含两个字段的博客表:
title <--- plain text
body <--- html format
鉴于博客记录,如何在全文查询中同时使用标题和正文来查找相关的博客帖子?
答案 0 :(得分:1)
试试:
select *, MATCH (title, body) AGAINST ('some words' IN BOOLEAN MODE) as searched from table where MATCH(`title`, `body`) AGAINST('some words' IN BOOLEAN MODE)DESC