Question: > 
> **Possible Duplicate:**  
> 
> [How does the Google “Did you mean?” Algorithm work?](https://stackoverflow.com/questions/307291/how-does-the-google-did-you-mean-algorithm-work) 
> 
> 
> 

I have a database table with about 2 million records. I'm using mysql fulltext to searching but users very often enter bad words ex gmes -> should be games so I need a library with PHP wrappers to have feature like in google 'did you mean' What should I use?

Answer: 
An index is a list of words, and the place they occur. E.g. games occurs on row 123 and 456. If you have such a list with all words, you can easily search for the word that matches best. This way, you could match gmes with games.

However, this is not possible with the index MySQL provides.
Another option would be the [PHP Pspell functions](http://www.php.net/manual/en/ref.pspell.php) in particular [pspell\_suggest](http://www.php.net/manual/en/function.pspell-suggest.php), but you need to install the [aspell library](http://aspell.net/) on the server.