Extension:CirrusSearch

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
CirrusSearch
Release status: stable
Implementation Search, API, Hook
Description Implements searching for MediaWiki using Elasticsearch
Author(s) Nik Everett, Chad Horohoe, Erik Bernhardson
Latest version 0.2.0 (continuous updates)
MediaWiki 1.23+
PHP 5.4+
Database changes No
License GNU General Public License 2.0 or later
Download
README
Parameters
  • $wgCirrusSearchServers
  • $wgCirrusSearchMaxRetries
  • $wgCirrusSearchSoftCommitTimeout
  • $wgCirrusSearchHardCommitTimeout
  • $wgCirrusSearchHardCommitMaxPendingDocs
  • $wgCirrusSearchCacheResultTime
  • $wgCirrusSearchCacheCleanupThread
  • $wgCirrusSearchFilterCacheSize
  • $wgCirrusSearchFilterCacheAutowarmCount
  • $wgCirrusSearchQueryResultCacheSize
  • $wgCirrusSearchQueryResultCacheAutowarmCount
  • $wgCirrusSearchDocumentCacheSize
  • many others
Hooks used
AfterImportPage
APIAfterExecute
ApiBeforeMain
ArticleDelete
ArticleDeleteComplete
ArticleRevisionVisibilitySet
BeforeInitialize
GetBetaFeaturePreferences
GetPreferences
LinksUpdateComplete
MediaWikiServices
ResourceLoaderGetConfigVars
ShowSearchHitTitle
SoftwareInfo
SpecialSearchResults
SpecialSearchResultsAppend
TitleMove
TitleMoveComplete
UnitTestsList
UserGetDefaultOptions
CirrusSearchBuildDocumentFinishBatch
CirrusSearchBuildDocumentLinks
Translate the CirrusSearch extension if it is available at translatewiki.net
Check usage and version matrix.
Vagrant role cirrussearch
Issues Open tasks · Report a bug

The CirrusSearch extension implements searching for MediaWiki using Elasticsearch.

See Help:CirrusSearch for documentation.

Project goals

  • 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

PHP and cURL
Elasticsearch
  • MediaWiki 1.28.x requires ElasticSearch 2.x.
  • MediaWiki 1.29.x and 1.30.x require ElasticSearch 5.3.x or 5.4.x.
  • MediaWiki 1.31.x requires ElasticSearch 5.5.x or 5.6.x.
Elastica
  • Elastica is a PHP library to talk to Elasticsearch. Install Elastica per the instructions below.

Installation

Elastica

  • 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
  • Yes 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

  • 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";
    
  • Now follow the setup instructions in the CirrusSearch README delivered with your extension i.e. $IP/extensions/CirrusSearch/README. Note that all info in it might not apply to your version of the extension, especially the version of Elasticsearch supported.
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Upgrading

Please follow the upgrade instructions in the CirrusSearch UPGRADE file.

Configuration

The configuration options of CirrusSearch are documented at the docs/settings.txt file, and also in the CirrusSearch.php file.

See also documentation on CirrusSearch configuration profiles.

Hooks

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:

API

CirrusSearch features can be used in API queries. A few examples and queries:

See also