[WikiEN-l] Temporary alternate search enabled

Brion Vibber brion at pobox.com
Wed Aug 6 11:35:42 UTC 2003


I've set up a static copy of the search index table to run on Larousse, 
the web server, separately from the main database server, and modified 
the wiki to run searches through it.

This is rather experimental, and I don't know if it'll remain smooth. If 
it doesn't play nice, it'll get disabled again. For now this is a static 
copy of the search index, so it won't automatically update with new 
pages, changed pages etc. But, it's better than nothing and should be 
more up to date than Google for the time being.

(I'd prefer to be running these sorts of things on a third machine, 
capable of being a full live backup database server, but we don't yet 
have one. Larousse does have plenty of free memory at the moment, so 
stealing some to run a limited-purpose mysqld shouldn't hurt it too much 
in the short term.)


Technical notes: the duplicate searchindex table has been modified to 
include the cur_is_redirect and cur_namespace columns out of cur, since 
these are used to narrow down the search. The modified search engine 
grabs a series of matching page ID numbers out of the alternate 
database, then grabs the current title and and contents from the real 
cur table using the index numbers for just the matches that it needs to 
display, which should be quite fast. I've also dropped the default 
number of results per page from 20 to 10.

I haven't checked in these experimental changes to CVS; a diff to 
SearchEngine.php is attached. Also slight change to 
DatabaseFunctions.php to support more options to wfGetDB() but it 
doesn't diff cleanly against the current version and I'm too tired to 
sort it out right now.

-- brion vibber (brion @ pobox.com)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: altsearch.diff
Url: http://lists.wikimedia.org/pipermail/wikien-l/attachments/20030806/1a263a10/attachment.diff 


More information about the WikiEN-l mailing list