开发者

What's the opposite of MATCH AGAINST?

开发者 https://www.devze.com 2023-04-12 13:23 出处:网络
I know: WHERE MATCH(title,cat开发者_Go百科egory) AGAINST (\'text\') But what if I want to say \'text\' cannot not be anywhere in title or category?

I know:

WHERE MATCH(title,cat开发者_Go百科egory) AGAINST ('text')

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

Many thanks

Darren


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


You could try the following:

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号