[nycphp-talk] Tuning MySQL Full Text Search

Ben Sgro (ProjectSkyLine) ben at
Wed Aug 22 10:50:54 EDT 2007

Hello All, 

I've got search for very small database working fine. However, I'd like to tune this to have 
different weights for words, because I'm not happy with the search results.

Are there any good books or whitepapers on tuning mysql for fulltext search?

Here's the query:

        $dbObject->DatabaseQuery('SELECT id, title, body, links_to,'
                                . ' MATCH(title, body)'
                                . ' AGAINST (' . $dbObject->Safe($searchStr)
                                . ' IN BOOLEAN MODE)'
                                . ' AS score FROM ' . DATABASE_TABLE_CONTENT
                                . ' WHERE MATCH (title, body)'
                                . ' AGAINST (' . $dbObject->Safe($searchStr)
                                . ' IN BOOLEAN MODE)'
                                . ' ORDER BY score DESC',
                                constReturnArray, LOG_LEVEL_DEBUG);

And here's the index code:
       $dbObject->DatabaseQuery('CREATE FULLTEXT INDEX skillings_index ON ' .
            DATABASE_TABLE_CONTENT . ' (title, body);', constReturnNone, LOG_LEVEL_DEBUG);   

- Ben

Ben Sgro, Chief Engineer
ProjectSkyLine - Defining New Horizons

Our company:
Our products:

This e-mail is confidential information intended only for the use of the individual to whom it is addressed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list