MySQL全文停用词问题 [英] MySQL full-text stopwords problem
问题描述
我有一个名为products的数据库和一个FULLTEXT索引,其中列为: title
和 description
。我所有的产品都是润滑剂(油),有两种类型:工业和自动机器,产率为55%-45%。
如果我在自动摩托车油之后进行搜索,那么它将不会返回任何结果,因为auto-moto关键字存在于多于一半的行中,并且所有这些油都存在,所以MySQL放入他们进入STOPWORDS列表。
我正在使用PHP。答案是 IN布尔模式(BOOLEAN MODE)
。如果你使用布尔模式,那么mysql会忽略这个密钥存在于多于50%的行中。在同一时间它有一个非常强大和有用的能力: AGAINST('* key *')
。
I have a database named "products" and a FULLTEXT index with the columns: title
and description
. All of my products are lubrifiants (oils), and there are two types of it: industrials and aut-moto, with a rate of 55%-45%.
If I make a search after auto-moto oils then it will return no results because the "auto-moto" keyword is present in more then half of the rows, and the oils in all of them, so the MySQL puts them into the STOPWORDS list.
I am using PHP. How can I make that query to give back the right results?
The answer is IN BOOLEAN MODE
. If you use boolean mode then the mysql will ignore that the key is present in more then 50% of the rows. In the same time it has a very strong and useful ability: AGAINST ('*key*')
.
这篇关于MySQL全文停用词问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!