Extension:SphinxSearch

''' NOTE: this is a work in progress. Please keep your eyes on this page if you are interested. Feel free to contact the author with any questions and status updates. '''

Step 1
Download Sphinx Search Engine. Follow the installation instructions.

Step 2
Create a sphinx.conf file in some directory (let's call it $SPHINX) with the following content: source src1 { type              = mysql strip_html       = 0 index_html_attrs =

sql_host         = localhost sql_user         = root sql_pass         = ***** sql_db           = wiki sql_port         = 3306 sql_sock         = /var/lib/mysql/mysql.sock

sql_query_pre    = sql_query        = SELECT old_id, old_text FROM wiki_text sql_query_post   = sql_query_info   = SELECT * FROM wiki_text WHERE old_id=$id }

source src1stripped : src1 { strip_html      = 1 }

index wiki { source          = src1 path           = $SPHINX/wiki.sphinx docinfo        = extern morphology     = none stopwords      = min_word_len   = 1 charset_type   = utf-8 min_prefix_len = 0 min_infix_len  = 0 }

index wikistemmed : wiki {  path          = $SPHINX/wikistemmed morphology   = stem_en }

indexer {  mem_limit     = 512M }

searchd { port          = 3312 log          = /tmp/sphinx-searchd.log query_log    = /tmp/sphinx-query.log read_timeout = 5 max_children = 30 pid_file     = /tmp/sphinx-searchd.pid max_matches  = 1000 }

Make sure to adjust all values to suit your setup. Pay careful attention to the sql_ settings and make sure to substitute all instances of $SPHINX with whichever directory you chose above.

Note: I have to give credit where credit is due. This sphinx.conf file was in large part borrowed from this excellent article.

Step 3
Run the sphinx indexer to prepare for searching: Once again, make sure to replace $SPHINX whatever you chose above. This process is actually pretty fast, but clearly depends on how large your wiki is. Just be patient and watch the screen for updates.

Step 4
When the indexer is finished, test that sphinx searching is actually working: