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: 
You could use Yahoo Spelling API etc. if your queries are very generic. But if you have a domain specific vocabulary then you are better off using [Apache Solr](http://lucene.apache.org/solr/).

You can use it to index your 2MM records, easy! And use it as a search server with faceting etc. It also generate a spell-checker index out of your records which you can use for your "did you mean"? or the auto-suggest feature. It is also exceedingly simple to integrate into any language because of its RESTful API

Bottom-line: if you are looking for a long-term solution that can handle several things, in addition to spell-checking, such as search/auto-suggest/faceting etc. Solr is the way to go.
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.