Topic on Extension talk:Zend Search Lucene for MediaWiki

Enhanced, more admin friendly Instructions (mediawiki 1.17.0)

8
Ucananduwill (talkcontribs)

On one hand, i finally got Zend Lucene to work, and on mediawiki 1.17.0, but not without having virtually any documentation that could help.

MediaWiki 1.17.0

PHP 5.3.6 (apache2handler)

MySQL 5.2.8-MariaDB-log


Step 1 - Install / Download Zend Framework Download Zend Framework. Unpack and copy the contents of the download file to a webserver folder (commonly not below web root). Zend Framework install is done! You're NOT exactly done. Here, I had to create a directory called 'zend', above web root (i.e. /var/www/zend) where i extracted the contents of the tar ball.

Step 2 - Configure Zend Search Lucene for MediaWiki Download and extract the extensions PslZslAdmin and PslZendSearchLucene to your Wiki(s) extension directory. Move the files PslZendSearchLuceneIndexer.php and PslZendSearchLuceneIndexerConfig.php to a server directory above web root. Edit the marked parts of the file PslZendSearchLuceneIndexerConfig.php as described in it.

This is where it gets tricky. The config file (PslZendSearchLuceneIndexerConfig.php) unfortunately lacks the proper comments to help any admin intuitively configure Zend in any reasonable ammount of time. Here are some suggestions i would recommend to any admin out there wanting to install Lucene:

1.) In my case, i didn't have an xml repository for my db dumps. So I created a 'source' folder where the xml dumps will be housed. I just created a 'sources' directory in <full path of Zend installation>/sources

2.) Here's how i would've labeled the parameters in the config file:


Instead of:

$wikisArray[0]['xmlSource']         = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/internal/internal_current.xml";

I would've put:

$wikisArray[0]['xmlSource']         = "<full path of xml dumps>/internal_current.xml";

In my case, again, i created a directory specifically designated for these dumps, which was /var/www/zend/sources


Instead of:

$wikisArray[0]['maintenanceScript'] = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/internal/httpdocs/wiki/maintenance/dumpBackup.php";
$wikisArray[0]['mediaDir']          = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/internal/public/";// maybe httpdocs/images/ if img_auth.php not in use


I would've put:

$wikisArray[0]['maintenanceScript'] = "<full path of mediawiki installation>/maintenance/dumpBackup.php";
$wikisArray[0]['mediaDir']          = "<full path of mediawiki installation>/images/";

In my case, <full path of mediawiki installation> = /var/www/html/wiki/mediawiki-1.17.0/


Instead of:

$wikisArray[1]['xmlSource']         = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/sysdoc/sysdoc_current.xml";

I would've put:

$wikisArray[1]['xmlSource']         = "<full path of xml dumps>/sysdoc_current.xml";

In my case, again, i created a directory specifically designated for these dumps, which was /var/www/zend/sources


Instead of

$wikisArray[1]['maintenanceScript'] = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/sysdoc/httpdocs/maintenance/dumpBackup.php";
$wikisArray[1]['mediaDir']          = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/sysdoc/public/";// maybe httpdocs/images/ if img_auth.php not in use


I would've put:

$wikisArray[1]['maintenanceScript'] = "<full path of mediawiki installation>/maintenance/dumpBackup.php";
$wikisArray[1]['mediaDir']          = "<full path of mediawiki installation>/images/";


Instead of:

$PhpExecutionStringUnix         = "/usr/bin/php -c /etc/php5/cli/php.ini";

I would've put:

$PhpExecutionStringUnix         = "/usr/bin/php -c /<location of php.ini file>/php.ini";

In my case <location of php.ini file> = /etc/


Instead of:

$webServerUser              = "www-data";
$webServerUserGroup         = "psaserv";
$zendFrameworkLibraryPath   = "/PSL_ADD_ONS/ZF/library";
$zendLogPath                = "/PSL_ADD_ONS/".$indexDirName."/";
$applicationPath            = "/PSL_ADD_ONS";


I would've put:

$webServerUser              = "<your web server user>";
$webServerUserGroup         = "<your web server group>";
$zendFrameworkLibraryPath   = "/<installation path of Zend>/ZendFramework-1.11.10/library";
$zendLogPath                = "/<installation path of Zend>/".$indexDirName."/";
$applicationPath            = "/<installation path of Zend>/";


3.) Here's how i would've labeled the config parameters for LocalSettings.php

/* Configuration Zend Search Lucene for MediaWiki - Start */
$PslDomainDir                   = "sysdoc";
$PslPhpExecutionStringUnix      = "/usr/bin/php -c /<full path to php.ini file>/php.ini ";
$PslMaintenancePath             = "/<full path to mediawiki installation>/maintenance/";
$PslXmlPath                     = "/<full path to xml dumps or sources>/".$PslDomainDir."_current.xml";

$wgPslZslAdminUseAutoReIndex    = false;
$wgPslZslAdminDefaultEmail      = "<your email address>";
$wgPslZslAdminDumpString        = $PslPhpExecutionStringUnix.$PslMaintenancePath."dumpBackup.php --current --quiet --uploads > ".$PslXmlPath;
$wgPslZslAdminMediaDir          = "<full path of mediawiki installation ir directory where you store uploaded docs>/images/";
$wgPslZslAdminReIndexString     = $PslPhpExecutionStringUnix."/<full path to Zend Installation>/PslZendSearchLuceneIndexer.php ".$PslXmlPath." wikidb_".$PslDomainDir." ".  $PslMaintenancePath."dumpBackup.php"; 

require_once( "$IP/extensions/PslZslAdmin/PslZslAdmin.php");

$wgSearchType                      = 'PslZendSearchLucene';
$wgPslEnableSuggestions            = true;//enables suggestions
$wgPslEnableStopWords              = false;//enables stop words
$wgPslStopWords                    = array('aber','als','am','an');
$wgPslImagePath                    = "http://<wiki domain or ip address of wiki server>/extensions/PslZendSearchLucene/";

$wgPslWikiUrl                      = "http://<wiki url>/mediawiki-1.17.0/index.php/";
$wgPslEntriesPerPage               = 20;
$wgPslUtf8DecodeResults            = false;//utf8-hint for related display issues, (play around with this if needed)
$wgPslIndexDir                     = "/<full path to Zend Installation>/psl_search_indexes/wikidb_".$PslDomainDir;
$wgPslZendLibraryDir               = "/<full path to Zend Installation>/ZendFramework-1.11.10/library/";
$wgPslEnablePopularSearches        = true;//requires table-create rights for MediaWikis db-account
$wgPslPopularSearchesHistory       = 365;//data remains 365 days
$wgPslProtectPopularSearches       = false;//
$wgPslHighlightColor               = "#ff6900";
$wgPslEnabaleDebugMode             = false;//debug mode
$wgPslEnableSuggestions            = true;//enables suggestions
$wgPslEnableFileSearch             = true;//enables file search
$wgPslEnablePsIpTracking           = false;//enables ip tracking for geo lacation services etc. (currently not implemented)
$wgPslEnableAnonKey                = true;//anonymous key for science
$wgPslHistoryEntries               = 30;//history entries per page
$wgPslHistoryMiniStat              = true;

$wgHiddenPrefs[] = 'searchlimit';//this entries are disabling no more needed user preferences of the old/default search
$wgHiddenPrefs[] = 'contextlines';
$wgHiddenPrefs[] = 'contextchars';
$wgHiddenPrefs[] = 'disablesuggest';
$wgHiddenPrefs[] = 'searcheverything';
$wgHiddenPrefs[] = 'searchnamespaces';
$wgPslEnableUserInHistory          = false;//enhanced knowledge management feature could tackle your country specific law!
require_once( "$IP/extensions/PslZendSearchLucene/PslZendSearchLucene.php");
/* Configuration Zend Search Lucene for MediaWiki - End */


4.) Finally, make sure you check your permissions! Your xml dump/source directory must be owned by the web server user and in the web server group. In my case, apache:apache. A simply chown -R apache:apache . in the Zend installation directory should do the trick.

Hope this helps!

Steviex2 (talkcontribs)

Thank you for your contributions. Nice to heare it's running on 1.17. We have several hundred downloads and less then 20 questions about setup till now. So this wasn't on my toDo-list :-).

92.41.125.1 (talkcontribs)

Thank you for taking the time for these instructions, they really helped me! It's an awesome extension but so confusing to set up at first glance. Now it breaks my template, but that's a minor thing to fix! :)

203.48.50.180 (talkcontribs)

The above very good for admins installing using *nix, I've been struggling under Windows to get this sorted, is there a Windows version of the above?

Reply to "Enhanced, more admin friendly Instructions (mediawiki 1.17.0)"