Extension:CirrusSearch

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
CirrusSearch

Release status:Extension status stable

ImplementationTemplate:Extension#type Search, API, Hook
DescriptionTemplate:Extension#description Implements searching for MediaWiki using Elasticsearch
Author(s)Template:Extension#username Nik Everett, Chad Horohoe, Erik Bernhardson
Latest versionTemplate:Extension#version 0.2 (2014-10-09)
MediaWikiTemplate:Extension#mediawiki 1.23+
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
README
ParametersTemplate:Extension#parameters
  • $wgCirrusSearchServers
  • $wgCirrusSearchMaxRetries
  • $wgCirrusSearchSoftCommitTimeout
  • $wgCirrusSearchHardCommitTimeout
  • $wgCirrusSearchHardCommitMaxPendingDocs
  • $wgCirrusSearchCacheResultTime
  • $wgCirrusSearchCacheCleanupThread
  • $wgCirrusSearchFilterCacheSize
  • $wgCirrusSearchFilterCacheAutowarmCount
  • $wgCirrusSearchQueryResultCacheSize
  • $wgCirrusSearchQueryResultCacheAutowarmCount
  • $wgCirrusSearchDocumentCacheSize
  • many others
Hooks usedTemplate:Extension#hook
AfterImportPageManual:Hooks/AfterImportPage
APIAfterExecuteManual:Hooks/APIAfterExecute
ApiBeforeMainManual:Hooks/ApiBeforeMain
ArticleDeleteManual:Hooks/ArticleDelete
ArticleDeleteCompleteManual:Hooks/ArticleDeleteComplete
ArticleRevisionVisibilitySetManual:Hooks/ArticleRevisionVisibilitySet
BeforeInitializeManual:Hooks/BeforeInitialize
GetBetaFeaturePreferencesManual:Hooks/GetBetaFeaturePreferences
GetPreferencesManual:Hooks/GetPreferences
LinksUpdateCompleteManual:Hooks/LinksUpdateComplete
MediaWikiServicesManual:Hooks/MediaWikiServices
ResourceLoaderGetConfigVarsManual:Hooks/ResourceLoaderGetConfigVars
ShowSearchHitTitleManual:Hooks/ShowSearchHitTitle
SoftwareInfoManual:Hooks/SoftwareInfo
SpecialSearchResultsManual:Hooks/SpecialSearchResults
SpecialSearchResultsAppendManual:Hooks/SpecialSearchResultsAppend
TitleMoveManual:Hooks/TitleMove
TitleMoveCompleteManual:Hooks/TitleMoveComplete
UnitTestsListManual:Hooks/UnitTestsList
UserGetDefaultOptionsManual:Hooks/UserGetDefaultOptions
CirrusSearchBuildDocumentFinishBatchManual:Hooks/CirrusSearchBuildDocumentFinishBatch
CirrusSearchBuildDocumentLinksManual:Hooks/CirrusSearchBuildDocumentLinks

Translate the CirrusSearch extension if it is available at translatewiki.net

Check usage and version matrix.
Vagrant roleMediaWiki-Vagrant#Using roles cirrussearch

IssuesPhabricator

Open tasks · Report a bug

The CirrusSearch extension implements searching for MediaWiki using Elasticsearch. See Help:CirrusSearch for documentation.

Project goals[edit]

  • No weird dependencies that make this difficult to install
    • The only dependencies should be pure-PHP MediaWiki extensions and Elasticsearch itself
  • Provide a near-real-time search index for wiki pages that's extendable by other MediaWiki extensions
  • Provide all of the query options MWSearch has given users, and more

Dependencies[edit]

  • PHP and cURL
  • Elasticsearch
    • You will need to install Elasticsearch. Information on installing/maintaining Elasticsearch itself can be found at elastic.co.
    • ElasticSearch 2.x is required starting with version 1.28. Use ElasticSearch 1.7 if you are on prior versions (version 1.7.3 is the latest on that branch).
  • Extension:Elastica
    • Elastica is a PHP library to talk to Elasticsearch. Install Elastica per the instructions below.

Installation[edit]

Elastica[edit]

  • Download and place the file(s) in a directory called Elastica in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'Elastica' );
  • In the downloaded files, open a command line and change to the subdirectory of the "Elastica" extension
  • Run composer install --no-dev
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'Elastica' );, you need to use:

require_once "$IP/extensions/Elastica/Elastica.php";

CirrusSearch[edit]

  • Download and place the file(s) in a directory called CirrusSearch in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/CirrusSearch/CirrusSearch.php";
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Now follow the setup instructions in the CirrusSearch README delivered with your extension i.e. $IP/extensions/CirrusSearch/README (Here's the most up-to-date version of the README. But note that all info in it might not apply to your version of the extension, especially the version of Elasticsearch supported.)

Configuration[edit]

$wgCirrusSearchServers

Should be configured with the servers (names or IP addresses) running elasticsearch without providing the port. For example:

$wgCirrusSearchServers = array( 'search01', 'search02' );

Other configuration is available and is documented in the CirrusSearch.php file.

Hooks[edit]

CirrusSearch extension defines a number of hooks that other extensions can make use of to extend the core schema and modify documents. The following hooks are available:

See also[edit]