MySQL full-text search-Boolean search_mysql

Source: Internet
Author: User
Tags mysql tutorial
MySQL full-text search uses in boolean mode to modify the program. MySQL can also execute BOOLEAN full-text search:

Mysql> SELECT * FROM articles where match (title, body)
-> AGAINST ('+ MySQL-yoursql' in boolean mode );
+ ---- + ----------------------- + ------------------------------------- +
| Id | title | body |
+ ---- + ----------------------- + ------------------------------------- +
| 1 | MySQL Tutorial | DBMS stands for DataBase... |
| 2 | How To Use MySQL Well | After you went through a... |
| 3 | Optimizing MySQL | In this tutorial we will show... |
| 4 | 1001 MySQL Tricks | 1. Never run mysqld as root. 2... |
| 6 | MySQL Security | When configured properly, MySQL... |
+ ---- + ----------------------- + ------------------------------------- +

This query retrieves all rows containing the word "MySQL", but does not retrieve rows containing the word "YourSQL.

Boolean full-text search has the following features:

◆ They do not use 50% domain values ..

◆ They do not classify rows in the order of weak correlations. You can see this from the above query results: the row with the highest relevance is a row containing two "MySQL", but it is listed at the last position rather than the start position.

◆ Even if FULLTEXT is not available, they can still work, although the search execution speed in this method is very slow.

◆ Full-text parameters of minimum word length and maximum word length are applicable.

◆ Applicable to stopword.

The performance of Boolean full-text search supports the following operators:

◆ +

A leading plus sign indicates that the word must appear at the beginning of each returned line.

◆-

A leading minus sign indicates that the word cannot appear in any returned row.

◆ (No operator)

In the default state (when not specified + or

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.