Installing MediaWiki Lucene-search

From Fyzix
Revision as of 17:02, 18 October 2014 by Fyzix (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This search plugin engine will offer enhanced full text searching.


apt-get install openjdk-7-jre-headless

Fetch the binary

Browse to:

Place files in /usr/local/lucene

cd /source
tar xvf lucene-search-bin-2.1.3.tar.gz
mv lucene-search-2.1.3 /usr/local/lucene


cd /usr/local/lucene

./configure /var/www/wiki

Start script


export PATH
cd /usr/local/lucene && ./lsearchd &

Make script executable

chmod u+x runlsearchd

Add this to rc.local


Fetch MWSearch

Browse to:


tar -xzf wikimedia-mediawiki-extensions-MWSearch-bdc9ea0.tar.gz -C /var/www/wiki/extensions
cd /var/www/wiki/extensions
mv wikimedia-mediawiki-extensions-MWSearch-bdc9ea0 MWSearch

Add the following code at the bottom of your LocalSettings.php. Be sure to set the LueceneHost properly.

require_once "$IP/extensions/MWSearch/MWSearch.php";
$wgSearchType = 'LuceneSearch';
$wgLuceneHost = ''; // IP address of the server
$wgLucenePort = 8123;
$wgLuceneSearchVersion = 2.1; // comment this out if you are using the old version 2.0

Create Build Index script


cd /usr/local/lucene

Make script executable

chmod u+x runrebuildindex

Create crontab to rebuild index

0 0     * * *   root    runrebuildindex &> /dev/null

Fire-up the daemon