StudioTime
StudioTime

Reputation: 23999

What's the opposite of MATCH AGAINST?

I know:

WHERE MATCH(title,category) AGAINST ('text')

But what if I want to say 'text' cannot not be anywhere in title or category?

Many thanks

Darren

Upvotes: 0

Views: 343

Answers (3)

Raz
Raz

Reputation: 605

You could try the following:

SELECT * FROM whatever WHERE MATCH (title,category) AGAINST ('-text' IN BOOLEAN MODE);

Upvotes: 1

SvenS
SvenS

Reputation: 795

Is there any problem with using WHERE NOT MATCH(title,category) AGAINST ('text')?

Upvotes: 0

Daren Chandisingh
Daren Chandisingh

Reputation: 2165

Use "IN BOOLEAN MODE" with the '-' specifier

WHERE MATCH (title,category) AGAINST ('-text' IN BOOLEAN MODE);

http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html

Upvotes: 2

Related Questions