2010-02-17 85 views
5

通过以下查询,我得到包含单词“International”和“Shipping”的结果,并且还得到包含“International”或“Shipping”的结果。我能做些什么来确保结果包含两个单词而不仅仅是其中一个单词?MySQL全文搜索 - 仅包含所有单词的结果

任何帮助将不胜感激,谢谢!

SELECT client_company,client_description,client_keywords 
FROM tb_clients 
WHERE 
MATCH (client_company,client_description,client_keywords) 
AGAINST ('International Shipping') > 0 
LIMIT 10 

回答

12

在每一个需要的字前面加上+和使用IN BOOLEAN MODE

11.8.2. Boolean Full-Text Searches

在执行此功能,MySQL使用有时被称为隐含布尔逻辑,其中

+ stands for AND 
- stands for NOT 
    [no operator] implies OR