SphinxSearch

From New World Encyclopedia
Revision as of 04:09, 4 October 2007 by Svemir Brkic (talk | contribs) (Starting the search extension documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

This site uses Sphinx full-text search engine as a replacement for standard MediaWiki search. Our code is based on SphinxSearch extension by Paul Grinberg. The changes we made include:

  • Changed the overall model based on LuceneSearch extension to make Sphinx the main (and only) search engine on this wiki.
  • Added support for the Go button so user is redirected to an exact title match automatically.
  • Changed the main data fetch query for the indexer to make it somewhat faster. Added page_id attribute to the index to make fetching of search results faster as well.
  • Added an incremental index. We index entire wiki every night and update the incremental index with articles changed since then several times a day.
  • Tweaked handling of namespaces, so initial search uses namespaces from user's preferences.

Installation

To install our version of this extension, first download and install Sphinx.

Now create a sphinx.conf file. Sphinx comes with well-commented sample file, but if you want to use our code, you need to start with our sphinx.conf and modify it further if necessary:

  • You will need to update the file paths and table names (if you use some prefix.)
  • If your wiki is very large, you may want to consider specifying a query range in the conf file.
  • If your wiki is not in English, you will need to change (or remove) the morphology attribute.

To be continued...