Extension:SphinxMultiSearch

SphinxMultiSearch is a fork of Extension:SphinxSearch 0.7.1, which adds the ability to search multiple databases simultaneously.

Method
SphinxMultiSearch works by:
 * 1) Running a union of the regular indexing SQL queries, so that a single index of all databases is created
 * 2) Then patching the existing code responsible for displaying results, in order to link correctly to each wiki instance.
 * 3) * Since the union of queries probably isn't the best approach, you could say that our main contribution here is the context-awareness.
 * 4) * Context-awareness is assisted by defining $wgSphinxMultiLanguages, an array of databases and wiki paths.

Caveats
This extension works quite well for our purposes; however, there are a number of issues with this approach:
 * 1) SphinxMultiSearch was aimed at a multi-lingual wiki farm, and wasn't generalized very well for other types of wiki farms. You can see it in the not so clear configuration options.
 * 2) Whoever installs the extension must manually modify the SQL queries to perform the needed union of his databases. This is not necessarily a big issue, as the configuration file (Sphinx's) must be modified anyway.
 * 3) It is not possible to select which databases to search at any given point (e.g., just search English right now) – it's all or nothing.
 * 4) It's still uses the old SphinxSearch UI... Instead of the newer MWSearch UI.

Download
Two separate software components are necessary, first you need the Sphinx Search Engine (hereafter called Sphinx) and second the SphinxSearch Extension (hereafter called extension).

Sphinx
Sphinx Search Engine.

Extension
Download from MediaFire (temporary location).

Installation Instructions
See Extension:SphinxSearch, with one difference: use of course the code and  file supplied supplied here, and update sql_query inside sphinx.conf to perform a union of queries from all of your databases (example in file).

Configuration
SphinxMultiSearch only adds one configuration option to the SphinxSearch configuration: $wgSphinxMultiLanguages, which is an array of Databases and wiki paths. It looks something like this:

Compatibility
This extension was only tested on MediaWiki 1.16 and MediaWiki 1.17.

ToDo

 * 1) (in process) Make SphinxMultiSearch compatible with SphinxSearch 0.8.5.
 * 2) Going forward, a better approach to multi-database searching is probably to index each DB separately, and then supply a list of such indexes using the current $wgSphinxMultiLanguages array. This will supply a number of benefits:
 * 3) * The default SQL query needs no changes out of the box
 * 4) * In theory, it will be possible to search databases individually (after adding the appropriate interface controls), or define different sets of databases to search for different wikis in the same farm.
 * 5) * Each index can actually be for a different language, with proper stemming, etc.
 * 6) * In theory, you could prioritize results by originating database
 * 7) * More?

Support

 * For issues related to SphinxMultiSearch-specific functionality, you can try and consult with User:FreedomFighterSparrow - I might be able to help.
 * For general inquiries about SphinxSearch, see Extension:SphinxSearch

Revisions

 * v0.7.1 - The only release ever, still unstable