How to Change MySQL FULLTEXT Index Minimum and Maximum Length of Words如何更改MySQL的全文索引的最小和最大長度的詞
MySQL database has built-in full-text search capability that allows SQL queries to perform search quickly using MySQL database engine. MySQL數據庫有內置的全文檢索功能,使SQL查詢執行搜尋快速使用MySQL數據庫引擎。 The full-text search capability depends on the FULLTEXT index which is been created on various table fields or columns.全文搜索能力取決於全文指數是已經建立的各種表字段或列。 However, some search queries may not return the experted results or datasets, even though the data is verified to exists on full-text search, especially on short keywords or search terms.然而,一些搜索查詢可能不會返回experted結果或數據,即使數據是核實存在於全文檢索,特別是對短期的關鍵字或搜索字詞。
The problem probably lies on the default minimum length of words indexed by FULLTEXT index which is set as 4 characters.這個問題可能在於默認最小長度的話收錄全文指數設定為4個字符。 Thus, when attempting to search via full-text index, the short words are not indexed, and hance not return in search results.因此,當試圖通過搜索全文索引,短期的話沒有索引,和碟子不返回搜索結果。
By default, the minimum value for length of word to be indexed in FULLTEXT index is four characters, while the default maximum length of words to be indexed in FULLTEXT index is varies depending on version of mySQL server.默認情況下,最低值為長度的詞索引的全文索引是四個字符,而默認的最大長度的話要建立索引的全文索引是根據不同版本的MySQL服務器。 To increase the number of words indexed and searchable, especially shorter words such as three-character words, administrator can reduce the minimum or increase the maximum length of words to be indexed by using ft_min_word_len and ft_max_word_len system variables.為了增加關鍵詞索引和搜索,尤其是短的詞語,如3個字符的話,管理員可以減少或增加的最低的最大長度的詞的索引使用ft_min_word_len和ft_max_word_len系統變量。
For example, for FULLTEXT index to index the three-character words, or 3-letter text, add in the following line to set the lower value for ft_min_word_len variable under [mysqld] section to an option file, ie my.cnf:舉例來說,全文索引,以指數的三個字符的話,或3個字母文字中添加下面一行設置較低的價值ft_min_word_len變量下[ mysqld ]部分的選項文件,即my.cnf :
[mysqld]
ft_min_word_len=3
Save the file, and then restart the MySQL server.保存該文件,然後重新啟動MySQL服務器。 After changing either value of full-text variable, which both affects indexing, the FULLTEXT indexes must be rebuilt.在不斷變化的價值,要么全文變量,這兩個影響索引,全文索引必須重建。 The following command to do a quick repair operating is sufficient to rebuild the indexes:下面的命令,做一個快速修復操作系統足以重建索引:
mysql> REPAIR TABLE tbl_name QUICK; MySQL的“ 快速修復表tbl_name ;
Note that each and every table that contains any FULLTEXT index must be repaired with SQL command above.請注意,每一個表,其中包含任何全文索引必須修復SQL命令以上。 Also do not use myisamchk (unless you have also defined the full-text parameter values in [myisamchk] section) to perform the rebuilt as the full-text parameters are only known to mysqld server.也沒有使用myisamchk (除非您還界定全文參數值在[ myisamchk ]節)執行重建作為全文參數只知道mysqld服務器。 If rebuild is not done, queries for the table may yield incorrect results, and modifications to the table will cause the server to see the table as corrupt and in need of repair.如果重建不這樣做,查詢的表可能會產生不正確的結果,並修改該表將導致服務器看到桌上的腐敗和需要修理。
IMPORTANT : You're reading a machine translated page which is provided "as is" without warranty. 重要說明 :您正在閱讀的機器翻譯網頁是“按原樣”提供的保證。 Unlike human translation, machine translation does not understand the grammar, semantics, syntax, idioms of natural language, thus often produce inaccurate and low quality text which is misleading and incomprehensible.不同於人工翻譯,機器翻譯不明白的語法,語義,句法,成語自然語言,因此,往往產生不準確的和低質量的文字這是誤導性的和不可理解的。 Thus, please refer to因此,請參閱 original English article英文原版的文章 when in doubt.如有疑問。
Related Articles相關文章
- MySQL Workbench - Visual Database Deign Tool Free Download MySQL的工作台-可視化數據庫設計工具的免費下載
- Aqua Words Free Word Puzzle Game from Realore Studios at GAOTD水詞自由詞遊戲由Realore工作室在GAOTD
- 64-bit (x64) Windows Vista SP1 (6001.1800) tcpip.sys Auto Patcher to Fix Event ID 4226 and Unlock Increase Maximum Connections Allowed 64位( x64 )的Windows Vista SP1的( 6001.1800 ) tcpip.sys自動修補程式,以解決事件ID 4226和UNLOCK增加最大連接寵物
- How to Change the Display Language (Including Welcome Screen) in Windows Vista如何更改顯示語言(包括歡迎屏幕)在Windows Vista
- How to Change Icon of Shortcut in Windows Vista
- How to Activate or Change to Windows Vista Ultimate Extras Glass or Pearl Sound Scheme如何激活或更改為Windows Vista旗艦版額外玻璃或珍珠聲音計劃
- How to Change the Microsoft Office Excel Protect Sheet Password如何更改的Microsoft Office Excel密碼保護工作表
- Download Windows Search 4.0 Preview下載Windows搜索4.0預覽
- How to Enable PAE in x86 32-bit Windows Server 2003 and 2000 to Use Large 4GB or More RAM Memory如何啟用PAE的x86 32位Windows Server 2003和2000年使用大型4GB或更多的RAM內存
- Make Searches with Natural Language on Powerset Search Engine使與自然語言檢索的Powerset的搜索引擎










































May 11th, 2008 08:21 08年5月11日08:21
Depends.視情況而定。 Normally it's located in /etc通常它位於在/ etc
May 11th, 2008 02:49 08年5月11日02:49
Yes, thnks, but where is this mysterious config file “my.cnf”?是的, thnks ,但這個神秘的配置文件“ my.cnf ” ?