2014年10月14日 星期二

mysql fulltext常用參數...

再my.conf加入下列參數,可分別將stopword關掉與min length設成1

以下為MyISAM
ft_min_word_len=1
ft_stopword_file=''


以下為InnoDB

innodb_ft_min_token_size=1
innodb_ft_server_stopword_table = ''
innodb_ft_enable_stopword=FALSE


官方說明

ft_min_word_len
Command-Line Format--ft_min_word_len=#
System Variable Nameft_min_word_len
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values
Typenumeric
Default4
Min Value1
The minimum length of the word to be included in a FULLTEXT index.
Note
FULLTEXT indexes must be rebuilt after changing this variable. Use REPAIR TABLE tbl_name QUICK.


ft_stopword_file
Command-Line Format--ft_stopword_file=file_name
System Variable Nameft_stopword_file
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values
Typefile name
The file from which to read the list of stopwords for full-text searches. The server looks for the file in the data directory unless an absolute path name is given to specify a different directory. All the words from the file are used; comments are not honored. By default, a built-in list of stopwords is used (as defined in the storage/myisam/ft_static.c file). Setting this variable to the empty string ('') disables stopword filtering. See also Section 12.9.4, “Full-Text Stopwords”.
Note:
FULLTEXT indexes must be rebuilt after changing this variable or the contents of the stopword file. Use REPAIR TABLE tbl_name QUICK.

innodb_ft_min_token_size
Introduced5.6.4
Command-Line Format--innodb_ft_min_token_size=#
System Variable Nameinnodb_ft_min_token_size
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values
Typenumeric
Default3
Min Value0
Max Value16
Minimum length of words that are stored in an InnoDB FULLTEXT index. Increasing this value reduces the size of the index, thus speeding up queries, by omitting common word that are unlikely to be significant in a search context, such as the English words a and to. For content using a CJK (Chinese, Japanese, Korean) character set, specify a value of 1.

 innodb_ft_server_stopword_table
Introduced5.6.4
Command-Line Format--innodb_ft_server_stopword_table=db_name/table_name
System Variable Nameinnodb_ft_server_stopword_table
Variable ScopeGlobal
Dynamic VariableYes
Permitted Values
Typestring
DefaultNULL
Name of the table containing a list of words to ignore when creating an InnoDB FULLTEXT index, in the format db_name/table_name.
Note:
The stopword table must be an InnoDB table, containing a single VARCHAR column named VALUE. The stopword table must exist before you specify its name in the configuration option value.

 innodb_ft_enable_stopword
Introduced5.6.4
Command-Line Format--innodb_ft_enable_stopword=#
System Variable Nameinnodb_ft_enable_stopword
Variable ScopeGlobal
Dynamic VariableYes
Permitted Values
Typeboolean
DefaultON
Specifies that a set of stopwords is associated with an InnoDB FULLTEXT index at the time the index is created. If the innodb_ft_user_stopword_table option is set, the stopwords are taken from that table. Else, if the innodb_ft_server_stopword_table option is set, the stopwords are taken from that table. Otherwise, a built-in set of default stopwords is used.


沒有留言:

張貼留言