Extension:SOLRSearch

History
This SOLRSearch extension was derived by Hypergrove from the Project Halo Enhanced Retrieval extension.

Setup
To install SOLRSearch, please follow the steps indicated below.
 * Download instructions
 * The latest release may be found at.

Tested on:
 * Read me Info
 * MediaWiki 1.17, 1.19
 * SOLR server 3.1 (in testing now)

1. Add to your LocalSettings.php:

--- require_once("extensions/EnhancedRetrieval/includes/EnhancedRetrieval.php"); ---

2. Then run: php {wiki-path}/extensions/EnhancedRetrieval/maintenance/setup.php

--- 3. Run the SOLR server

Documentation is below.

That's it.

Installation of the SOLR server for Faceted Search

=
=====================================

The Apache Solr indexer is needed for the special page Special:FacetedSearch.

You can download a preconfigured ZIP with Apache Solr from sourceforge: http://sourceforge.net/projects/smwplus

1. Extract the ZIP to any directory of your choice (which we will call {solr-path}). 2. Enter your database credentials 2.1 Open {solr-path}/solr/wiki/solr/conf/smwdb-data-config.xml in an editor 2.2 You will find this in line 5: url="jdbc:mysql://:/" 2.3 Replace by the name of server that hosts your wiki database e.g. localhost 2.4 Replace by the port of the database e.g. 3306 2.5 Replace by the name of database e.g. semwiki_en 3. Go to folder {solr-path}/solr/wiki and open a command line there. 4. Run "startSolr.bat" 5. Create the initial full index by running "php createIndex.php" 6. Configure the SOLR access point in your wiki 6.1 Open {wiki-path}/extensions/EnhancedRetrieval/includes/FacetedSearch/FS_Settings.php 6.2 You will find a definition like this: $fsgFacetedSearchConfig = array(	   'indexer' => 'SOLR',	    'source'  => 'SMWDB',	    'host'    => '127.0.0.1',	    'port'    => 8983	); Replace the value of 'host' with the IP-address of your wiki server or its name e.g.'myserver.mycompany.org' 7. Test Faceted Search in your wiki. Open the page "Special:FacetedSearch"

If you are using Faceted Search together with HaloACL you have to configure solrproxy.php:

Configuration of solrproxy.php for HaloACL

As solrproxy.php is not executed in the MediaWiki environment it needs its own configuration if HaloACL is active. All settings are stored in an array in variable $spgHaloACLConfig. A typical configuration may look like this:

$spgHaloACLConfig = array(	'wikiDBprefix'	=> ,	'wikiDBname'	=> 'semwiki_en',	'cookiePath'	=> '/',		 // must be equal to $wgCookiePath	'cookieDomain'	=> , 		 // must be equal to $wgCookieDomain = "";	'cookieSecure'	=> false,	 // must be equal to $wgCookieSecure = false;	'cookieHttpOnly'	=> true, // must be equal to $wgCookieHttpOnly = true;	'memcacheconfig' => array( 'servers' => array('localhost:11211'), 'debug'  => false, 'compress_threshold' => 10240, 'persistant' => true),	'mediawikiIndex' => 'http://localhost/mediawiki/index.php',	'categoryNS'	=> 14,	'propertyNS'	=> 102,	'contentlanguage' => 'en' );

Several entries in this configuration can be copied from the MediaWiki configuration. Here is a detailed explanation of the settings:

wikiDBprefix This is the prefix of the wiki database. It is used for generating the memcache key for access rights. It must be equal to $wgDBprefix in MW. wikiDBname This is the name of the wiki database. It is used for generating the memcache key for access rights. It must be equal to $wgDBname in MW. cookiePath The cookie path is used to find out which wiki user makes the SOLR request. It must be equal to $wgCookiePath which can normally be found in DefaultSettings.php. cookieDomain The cookie domain is used to find out which wiki user makes the SOLR request. It must be equal to $wgCookieDomain which can normally be found in DefaultSettings.php. cookieSecure The cookie secure setting is used to find out which wiki user makes the SOLR request. It must be equal to $wgCookieSecure which can normally be found in    DefaultSettings.php. cookieHttpOnly The cookie http setting is used to find out which wiki user makes the SOLR request. It must be equal to $wgCookieHttpOnly which can normally be found in DefaultSettings.php. memcacheconfig This array defines several settings for the memcache:

servers The list of MemCached servers and port numbers. It must be equal to        $wgMemCachedServers which can normally be found in DefaultSettings.php. debug If enabled, will send MemCached debugging information to $wgDebugLogFile. It must be equal to $wgMemCachedDebug which can normally be found in        DefaultSettings.php. compress_threshold If a block of data has more bytes than this value, the block will be        compressed. persistant Use persistent connections to MemCached, which are shared across multiple requests. Find the default value of the corresponding $wgMemCachedPersistent in DefaultSettings.php.

mediawikiIndex' => 'http://localhost/mediawiki/index.php' This is the base URL of the wiki as seen from the solrproxy. It is used for sending Ajax requests. categoryNS This is the index of the category namespace in MediaWiki. It must be equal to the value of NS_CATEGORY (see Defines.php). propertyNS This is the index of the property namespace in SemanticMediaWiki. It must be    equal to the value of SMW_NS_PROPERTY (see SMW_Setup.php). contentlanguage This is the code of the current content language. It must be equal to $wgLanguageCode.

From the list of Special pages, go to page “Special:Search”.

Languages
SOLRSearch has support for:
 * English
 * German

Wishlist
Generally this extension has two parts: SOLRProxy and SOLRClient.

SOLRProxy

 * use Solarium php library
 * special page to monitor the SOLR host interface

SOLRClient

 * eliminate prototype.js dependency
 * enable client to scan multiple SOLR hosts simultanteously