user3188544
user3188544

Reputation: 1631

Matching two fields to find related results using MySQL fulltext?

I have a blog table with two fields:

title  <--- plain text
body   <--- html format

Given a blog record, how can I find related blog posts by utilizing both the title and the body in a fulltext query?

Upvotes: 0

Views: 23

Answers (1)

echo_Me
echo_Me

Reputation: 37253

try that:

  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

Upvotes: 1

Related Questions