我正在嘗試執行完整的測試搜索。而這樣做的第一件事,我做了/etc/mysql/my.cnf改變ft_min_word_len = 2
值作爲mysql ft_min_word_len在Ubuntu上更改不起作用
[mysqld]
#
# * Basic Settings
#
#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#
ft_min_word_len = 2
現在保存的並重新啓動服務器。 我知道,如果我已經有一個索引與表中的FULLTEXT我將需要刪除索引和重建,或修復表。 但我已經創建的表作爲
create table
`comments`
( `id` int(11),
`comment` varchar(200),
`iduser` int(11) ,
`date_added` datetime
)
ENGINE=MyISAM;
ALTER TABLE comments
ADD FULLTEXT INDEX comment_index
(comment);
然後在上表中我有手動添加一些評論。
當我試圖尋找的東西作爲
SELECT * FROM comments where MATCH (comment) AGAINST ('the') ; // "the" is very common word of length to see my test result
它返回0行。
但是,如果我將AGAINST設置爲4的字長,它就可以工作。
我試圖檢查ft_變量
mysql> show variables like 'ft_%';
+--------------------------+----------------+
| Variable_name | Value |
+--------------------------+----------------+
| ft_boolean_syntax | + -><()~*:""&| |
| ft_max_word_len | 84 |
| ft_min_word_len | 2 |
| ft_query_expansion_limit | 20 |
| ft_stopword_file | (built-in) |
+--------------------------+----------------+
有趣的事情是在/etc/mysql/my.cnf
我只能看到ft_min_word_len
但ft_max_word_len
是不存在的,更重要的是搜索不到長度4不atall工作。
這讓我瘋狂,不知道是否有其他配置寫過所有內容,似乎也找不到它們。
任何幫助,將不勝感激。
MySQL版本在我的機器是
mysql Ver 14.14 Distrib 5.1.63, for debian-linux-gnu (i686) using readline 6.2