Full-Text Searches with Query Expansion performed elsewhere, such as in the MySQL command-line client or other types of calculators. This example demonstrates the relevancy ranking calculation for a multiple-word full-text search based on the  articles  table and data used in the previous example. If you search on more than one word, the relevancy ranking value is a sum of the relevancy ranking value for each word, as shown in this formula: Performing a search on two terms (’mysql tutorial’) returns the following results: In the first record ( id 8 ), ’mysql’ appears once and ’tutorial’ appears twice. There are six matching records for ’mysql’ and two matching records for ’tutorial’. The MySQL command-line client returns the expected ranking value when inserting these values into the ranking formula for a multiple word search: The slight difference in the ranking values returned by the  SELECT ... MATCH ... AGAINST  statement and the MySQL command-line client is explained in the preceding example. Full-text search supports query expansion (and in particular, its variant “blind query expansion” ). This is generally useful when a search phrase is too short, which often means that the user is relying on implied knowledge that the full-text search engine lacks. For example, a user searching for “database”  may really mean that “MySQL” , “Oracle” , “DB2” , and “RDBMS”  all are phrases that should match “databases”  and should be returned, too. This is implied knowledge. Blind query expansion (also known as automatic relevance feedback) is enabled by adding  WITH QUERY EXPANSION  or  IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION  following the search phrase. It works by performing the search twice, where the search phrase for the second search is the original search phrase concatenated with the few most highly relevant documents from the first search. Thus, 2212 12.10.3 Full-Text Searches with Query Expansion ${rank} = ${TF} * ${IDF} * ${IDF} + ${TF} * ${IDF} * ${IDF} Relevancy Ranking for a Multiple Word Search mysql> SELECT id, title, body, MATCH (title,body) AGAINST (’mysql tutorial’ IN BOOLEAN MODE) AS score FROM articles ORDER BY score DESC; +----+------------------------------+-------------------------------------+----------------------+ | id | title | body | score | +----+------------------------------+-------------------------------------+----------------------+ | 1 | MySQL Tutorial | This database tutorial ... | 0.7405621409416199 | | 3 | Optimizing Your Database | In this database tutorial ... | 0.3624762296676636 | | 5 | MySQL Security | When configured properly, MySQL ... | 0.031219376251101494 | | 8 | MySQL Full-Text Indexes | MySQL fulltext indexes use a .. | 0.031219376251101494 | | 2 | How To Use MySQL | After you went through a ... | 0.015609688125550747 | | 4 | MySQL vs. YourSQL | When comparing databases ... | 0.015609688125550747 | | 7 | 1001 MySQL Tricks | 1. Never run mysqld as root. 2. ... | 0.015609688125550747 | | 6 | Database, Database, Database | database database database | 0 | +----+------------------------------+-------------------------------------+----------------------+ 8 rows in set (0.00 sec) mysql> SELECT (1*log10(8/6)*log10(8/6)) + (2*log10(8/2)*log10(8/2)); +-------------------------------------------------------+ | (1*log10(8/6)*log10(8/6)) + (2*log10(8/2)*log10(8/2)) | +-------------------------------------------------------+ | 0.7405621541938003 | +-------------------------------------------------------+ 1 row in set (0.00 sec) Note