Boolean Full-Text Searches title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; Query OK, 0 rows affected (1.04 sec) mysql> INSERT INTO articles (title,body) VALUES (’MySQL Tutorial’,’This database tutorial ...’), ("How To Use MySQL",’After you went through a ...’), (’Optimizing Your Database’,’In this database tutorial ...’), (’MySQL vs. YourSQL’,’When comparing databases ...’), (’MySQL Security’,’When configured properly, MySQL ...’), (’Database, Database, Database’,’database database database’), (’1001 MySQL Tricks’,’1. Never run mysqld as root. 2. ...’), (’MySQL Full-Text Indexes’, ’MySQL fulltext indexes use a ..’); Query OK, 8 rows affected (0.06 sec) Records: 8 Duplicates: 0 Warnings: 0 mysql> SELECT id, title, body, MATCH (title,body) AGAINST (’database’ IN BOOLEAN MODE) AS score FROM articles ORDER BY score DESC; +----+------------------------------+-------------------------------------+---------------------+ | id | title | body | score | +----+------------------------------+-------------------------------------+---------------------+ | 6 | Database, Database, Database | database database database | 1.0886961221694946 | | 3 | Optimizing Your Database | In this database tutorial ... | 0.36289870738983154 | | 1 | MySQL Tutorial | This database tutorial ... | 0.18144935369491577 | | 2 | How To Use MySQL | After you went through a ... | 0 | | 4 | MySQL vs. YourSQL | When comparing databases ... | 0 | | 5 | MySQL Security | When configured properly, MySQL ... | 0 | | 7 | 1001 MySQL Tricks | 1. Never run mysqld as root. 2. ... | 0 | | 8 | MySQL Full-Text Indexes | MySQL fulltext indexes use a .. | 0 | +----+------------------------------+-------------------------------------+---------------------+ 8 rows in set (0.00 sec) ${IDF} = log10( 8 / 3 ) = 0.42596873216370745 ${rank} = ${TF} * ${IDF} * ${IDF} mysql> SELECT 6*log10(8/3)*log10(8/3); +-------------------------+ | 6*log10(8/3)*log10(8/3) | +-------------------------+ | 1.088696164686938 | +-------------------------+ 1 row in set (0.00 sec) You may notice a slight difference in the ranking values returned by the SELECT ... MATCH ... AGAINST  statement and the MySQL command-line client ( 1.0886961221694946  versus  1.088696164686938 ). The difference is due to how the casts between integers and floats/doubles are performed internally by  InnoDB  (along with related precision and rounding decisions), and how they are Note 2211 Performing the calculation in the MySQL command-line client returns a ranking value of 1.088696164686938. The  TF  and  IDF  values are then entered into the ranking formula: There are 8 records in total, with 3 that match the “database”  search term. The first record ( id 6 ) contains the search term 6 times and has a relevancy ranking of  1.0886961221694946 . This ranking value is calculated using a  TF  value of 6 (the “database”  search term appears 6 times in record  id 6 ) and an  IDF value of 0.42596873216370745, which is calculated as follows (where 8 is the total number of records and 3 is the number of records that the search term appears in):