About MySQL full-text indexing

Source: Internet
Author: User

Full-text indexing has been supported since MySQL 4.0, but the default minimum index length for MySQL is 4. If the English default value is reasonable, but the majority of Chinese words are 2 characters, which results in less than 4 words can not be indexed, full-text indexing function is a fake. Most of the domestic space quotient probably did not notice this problem, did not modify the Mysql default setting.

Why use full-text indexing?

General database Search is a SQL like statement, like statements can not take advantage of the index, each query is from the first one to traverse to the last, query efficiency is extremely low. General data is more than 100,000 or too many people online, like queries can cause the database to crash. That's why many programs provide only a title search, because if you search for content, it's even slower, and tens of thousands of of the data is not moving.

Mysql Full-text indexing is specifically designed to solve fuzzy queries provided by the entire article in advance according to the word index, the search efficiency is high, can support millions data retrieval.

If you are using your own server, please set it up right away, and don't waste this feature.

If you are using a virtual host, please contact the space provider to modify the configuration immediately. First, this default for Mysql is a bad setting for Chinese, and modifying the settings equals correcting the error. Second, this configuration modification is simple, that is, a few minutes of things, and the increase in search efficiency also reduces the probability of the space quotient database downtime. If you send this article to the space business, I believe most of them will be willing to change.

Setup method:

For 5.5

# mysql Full-text index query keyword minimum length limit

Ft_min_word_len

Full-text variables that affect the index (Ft_min_word_len, Ft_max_word_len, or ft_stopword_file), or if you change the disable Word file itself, you must rebuild your fulltext index after changing and restarting the server. At this point, to rebuild the index, only a quick repair operation is required:

Mysql>repair TABLE tbl_name QUICK; #重建索引 # mysql Full-text index query keyword minimum length limit for 5.6innodb_ft_min_token_size

About MySQL full-text indexing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.