User:Jacebenson~mediawikiwiki/SphinxSearch

 '0.6.1',    'name'        => 'SphinxSearch',    'author'      => 'Svemir Brkic, Paul Grinberg',    'email'       => 'svemir at thirdblessing dot net, gri6507 at yahoo dot com',    'url'         => 'http://www.mediawiki.org/wiki/Extension:SphinxSearch',    'description' => 'Replace MediaWiki search engine with Sphinx.' );

if (!class_exists('SphinxClient')) { require_once ( dirname( __FILE__ ) . "/sphinxapi.php" ); }
 * 1) this assumes you have copied sphinxapi.php from your Sphinx
 * 2) installation folder to your SphinxSearch extension folder

$wgSphinxSearch_host = 'localhost'; $wgSphinxSearch_port = 3312;
 * 1) Host and port on which searchd deamon is tunning

$wgSphinxSearch_index = "wiki_main";
 * 1) Main sphinx.conf index to search

$wgSphinxSearch_mode = SPH_MATCH_EXTENDED;
 * 1) Default Sphinx search mode


 * 1) By default, search will return articles that match any of the words in the search
 * 2) To change that to require all words to match by default, uncomment the next line
 * 3) $wgSphinxMatchAll = 1;

$wgSphinxSearch_matches = 10; $wgSphinxSearch_maxmatches = 1000; $wgSphinxSearch_cutoff = 0;
 * 1) Number of matches to display at once
 * 1) How many matches searchd will keep in RAM while searching
 * 1) When to stop searching all together (if different from zero)

$wgSphinxSearch_weights = array('old_text'=>1, 'page_title'=>100);
 * 1) Weights of individual indexed columns. This gives page titles extra weight


 * 1) If you want to enable hierarchical category search, specify the top category of your hierarchy here
 * 2) $wgSphinxTopSearchableCategory = 'Subject_areas';


 * 1) If you want sub-categories to be fetched as parent categories are checked,
 * 2) also set $wgUseAjax to true in your LocalSettings file, so that the following can be used:
 * 3) $wgAjaxExportList[] = 'SphinxSearch::ajaxGetCategoryChildren';

$wgSphinxSearchExtPath = '/extensions/SphinxSearch';
 * 1) Web-accessible path to the extension's folder
 * 1) Web-accessible path to the folder with SphinxSearch.js file (if different from $wgSphinxSearchExtPath)
 * 2) $wgSphinxSearchJSPath = '';


 * 1) Use Aspell to suggest possible misspellings. This could be provided via either
 * 2) PHP pspell module (http://www.php.net/manual/en/ref.pspell.php) or command line
 * 3) insterface to ASpell
 * 1) insterface to ASpell

$wgSphinxSuggestMode = false;
 * 1) Should the suggestion mode be enabled?


 * 1) Path to where aspell has location and language data files. Leave commented out if unsure
 * 2) $wgSphinxSearchPspellDictionaryDir = "/usr/lib/aspell";


 * 1) Path to personal dictionary (for example personal.en.pws.) Needed only if using a personal dictionary
 * 2) $wgSphinxSearchPersonalDictionary = "";


 * 1) Path to Aspell. Needed only if using command line interface instead of the PHP built in PSpell interface.
 * 2) $wgSphinxSearchAspellPath = "/usr/bin/aspell";
 * 3) End of Suggest Mode configuration options

$wgDisableInternalSearch = true; $wgDisableSearchUpdate = true; $wgSearchType = 'SphinxSearch';
 * 1) To completely disable the default search and replace it with ours, uncomment these three lines
 * 1) To completely disable the default search and replace it with ours, uncomment these three lines
 * 1) Above three lines should be uncommented to make SphinxSearch the default

if ( !function_exists( 'extAddSpecialPage' ) ) { # Download from http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ExtensionFunctions.php require_once( dirname(__FILE__) . '/ExtensionFunctions.php' ); }

extAddSpecialPage( dirname(__FILE__) . '/SphinxSearch_body.php', ($wgDisableInternalSearch ? 'Search' : 'SphinxSearch'), 'SphinxSearch' );

if ($wgSphinxSuggestMode) { require_once(dirname(__FILE__) . '/SphinxSearch_spell.php'); }

if ($wgSphinxSuggestMode && $wgSphinxSearchPersonalDictionary) { extAddSpecialPage(dirname(__FILE__) . '/SphinxSearch_PersonalDict.php', 'SphinxSearchPersonalDict', 'SphinxSearchPersonalDict'); }

?>