Noise Words : Word « FullText Search « SQL / MySQL






Noise Words

    
mysql>
mysql> CREATE TABLE ft2(f1 VARCHAR(255),FULLTEXT(f1));
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO ft2 VALUES
    ->  ('Waiting for the Barbarians'),
    ->  ('In the Heart of the Country'),
    ->  ('The Master of Petersburg'),
    ->  ('Writing and Being'),
    ->  ('Heart of the Beast'),
    ->  ('Heart of the Beest'),
    ->  ('The Beginning and the End'),
    ->  ('Master Master'),
    ->  ('A Barbarian at my Door');
Query OK, 9 rows affected (0.00 sec)
Records: 9  Duplicates: 0  Warnings: 0

mysql>
mysql>
mysql> SELECT * FROM ft2 WHERE MATCH(f1) AGAINST ('Master');
+--------------------------+
| f1                       |
+--------------------------+
| Master Master            |
| The Master of Petersburg |
+--------------------------+
2 rows in set (0.00 sec)

mysql>
mysql> SELECT * FROM ft2 WHERE MATCH(f1) AGAINST ('The Master');
+--------------------------+
| f1                       |
+--------------------------+
| Master Master            |
| The Master of Petersburg |
+--------------------------+
2 rows in set (0.00 sec)

mysql>
mysql>
mysql> SELECT * FROM ft2 WHERE MATCH(f1) AGAINST ('for');
Empty set (0.00 sec)

mysql>
mysql>
mysql> SELECT f1, (MATCH(f1) AGAINST ('Master')) FROM ft2;
+-----------------------------+--------------------------------+
| f1                          | (MATCH(f1) AGAINST ('Master')) |
+-----------------------------+--------------------------------+
| Waiting for the Barbarians  |                              0 |
| In the Heart of the Country |                              0 |
| The Master of Petersburg    |               1.22459721565247 |
| Writing and Being           |                              0 |
| Heart of the Beast          |                              0 |
| Heart of the Beest          |                              0 |
| The Beginning and the End   |                              0 |
| Master Master               |               1.23852002620697 |
| A Barbarian at my Door      |                              0 |
+-----------------------------+--------------------------------+
9 rows in set (0.00 sec)

mysql>
mysql> SELECT f1,(MATCH(f1) AGAINST ('Master')) FROM ft2
    ->  WHERE MATCH(f1) AGAINST ('Master');
+--------------------------+--------------------------------+
| f1                       | (MATCH(f1) AGAINST ('Master')) |
+--------------------------+--------------------------------+
| Master Master            |               1.23852002620697 |
| The Master of Petersburg |               1.22459721565247 |
+--------------------------+--------------------------------+
2 rows in set (0.00 sec)

mysql>
mysql>
mysql> drop table ft2;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.Performs an OR search for any of the words.
2.Requiring or Excluding FULLTEXT Search Words
3.Get the numbers and titles of the books in which the word to appears.
4.Get the numbers and titles of the books in which the word database appears.
5.Get the numbers and titles of the books in which the word practical appears.
6.Get the numbers and relevance values of the books in which the word introduction appears in the title.
7.Get the numbers and titles of the books in which the word practical and/or the word distributed appears in the
8.Get the numbers and titles of the books in which the word careers appears in the title and/or the summary.
9.Get the numbers and titles of the books in which the word database and/or the word design appears.
10.Get the numbers and titles of the books in which the words database and design appear.
11.Give the numbers and titles of the books in which the word database appears, but not the word design.
12.Get the numbers and titles of the books in which words appear that begin with data.
13.Give the numbers and titles of the books in which the word sql appears.
14.Search for a word