Extension:SphinxSearch/Search suggestions

Latest SVN build has improved search suggestions for SphinxMWSearch - using enchant library and a script that creates a "dictionary" based on the frequency of words in your wiki (so it will never suggest a word that is not actually in the wiki.) I decided to use enchant because direct support for aspell/pspell is being dropped from PHP (at least on Windows) and I could not even install them on my box with php 5.3.

To try it, install enchant, run SphinxSearch_setup.php to create a dictionary, and set $wgSphinxSuggestMode to 'enchant'. Without enchant, you can set $wgSphinxSuggestMode to 'soundex' and it will use mysql's SOUNDEX to find wiki articles that sound similar to the search query. Svemir Brkic 15:35, 14 November 2010 (UTC)

Old method is currently still supported, but only via aspell binary, not via pspell extension. Set $wgSphinxSuggestMode to 'aspell' for that. Svemir Brkic 18:49, 7 September 2011 (UTC)

Enchant
Enchant is a library that provides a generic interface to third-party spell-checking APIs developed by

Create a dictionary
Execute SphinxSearch_setup.php to create necessary dictionary files sphinx.dic and sphinx.aff.

Using Enchant with PHP on Windows
See information about Using Enchant with PHP on Windows

Soundex
According to Wikipedia, soundex is a phonetic algorithm for indexing names by sound. MySQL uses soundex as function to determine and compare two strings that sound almost the same and should return identical soundex strings.

Aspell
When using the personal dictionary, it is not just a list of words. It needs to have a header line. http://aspell.net/man-html/Format-of-the-Personal-and-Replacement-Dictionaries.html

For example:

This could be a sample Windows aspell configuration: