Performing FULLTEXT Searches

In Chapter 4, the LIKE keyword was introduced as a way to perform somewhat simple string matches like

SELECT * FROM users WHERE last_name
→ LIKE 'Smith%'

This type of conditional is effective enough but is still very limiting. For example, it would not allow you to do Google-like searches using multiple words. For those kinds of situations, you need FULLTEXT searches.

FULLTEXT searches require a FULLTEXT index, which you’ll create next. Then you’ll learn the special SQL syntax for performing these searches. Finally, you’ll read about some capabilities added in MySQL 4.0.1 to make your FULLTEXT searches more exacting.

Creating a FULLTEXT Index

The FULLTEXT index is just a special type of index necessary to run ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.