m.mediawiki.org
Extension:CirrusSearch
Other languages:
Bahasa Indonesia Deutsch EnglishTürkçe français português do Brasilsvenska русский हिन्दी 中文日本語
MediaWiki extensions manual
CirrusSearch
Release status: stable
ImplementationSearch, API, Hook
DescriptionImplements searching for MediaWiki using Elasticsearch
Author(s)Nik Everett, Chad Horohoe, Erik Bernhardson
Latest versioncontinuous updates
Compatibility policySnapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki>= 1.37.0
LicenseGNU General Public License 2.0 or later
DownloadDownload extension
Git [?]:
README
HelpHelp:Extension:CirrusSearch
Parameters
  • $wgCirrusSearchLanguageWeight
  • $wgCirrusSearchAutomationCIDRs
  • $wgCirrusSearchUseIcuFolding
  • $wgCirrusSearchStemmedWeight
  • $wgCirrusSearchQueryStringMaxDeterminizedStates
  • $wgCirrusSearchCrossClusterSearch
  • $wgCirrusSearchExtraIndexSettings
  • $wgCirrusSearchAutomationUserAgentRegex
  • $wgCirrusSearchTalkNamespaceWeight
  • $wgCirrusSearchPrefixWeights
  • $wgCirrusSearchPrefixSearchRescoreProfile
  • $wgCirrusSearchDisableUpdate
  • $wgCirrusSearchActiveTest
  • $wgCirrusSearchMoreLikeThisMaxQueryTermsLimit
  • $wgCirrusSearchUseIcuTokenizer
  • $wgCirrusSearchCompletionBannedPageIds
  • $wgCirrusSearchOptimizeIndexForExperimentalHighlighter
  • $wgCirrusSearchRescoreProfiles
  • $wgCirrusSearchPhraseRescoreBoost
  • $wgCirrusSearchInterwikiProv
  • $wgCirrusSearchDefaultCluster
  • $wgCirrusSearchElasticQuirks
  • $wgCirrusSearchMaxFileTextLength
  • $wgCirrusSearchFallbackProfiles
  • $wgCirrusSearchMoreLikeThisTTL
  • $wgCirrusSearchAllowLeadingWildcard
  • $wgCirrusSearchInterwikiPrefixOverrides
  • $wgCirrusSearchMaintenanceTimeout
  • $wgCirrusSearchReplicas
  • $wgCirrusSearchPhraseSlop
  • $wgCirrusSearchBoostOpening
  • $wgCirrusSearchWriteBackoffExponent
  • $wgCirrusSearchUserTesting
  • $wgCirrusSearchShardCount
  • $wgCirrusSearchUseCompletionSuggester
  • $wgCirrusSearchPhraseSuggestReverseField
  • $wgCirrusSearchFallbackProfile
  • $wgCirrusSearchFragmentSize
  • $wgCirrusSearchUnlinkedArticlesToUpdate
  • $wgCirrusSearchClientSideUpdateTimeout
  • $wgCirrusSearchIgnoreOnWikiBoostTemplates
  • $wgCirrusSearchRegexMaxDeterminizedStates
  • $wgCirrusSearchInterwikiHTTPConnectTimeout
  • $wgCirrusSearchExtraIndexes
  • $wgCirrusSearchCategoryDepth
  • $wgCirrusSearchMergeSettings
  • $wgCirrusSearchClusters
  • $wgCirrusSearchAllFields
  • $wgCirrusSearchBannedPlugins
  • $wgCirrusSearchMoreLikeThisConfig
  • $wgCirrusSearchClusterOverrides
  • $wgCirrusSearchCrossProjectBlockScorerProfiles
  • $wgCirrusSearchNearMatchWeight
  • $wgCirrusSearchReplicaGroup
  • $wgCirrusSearchIndexedRedirects
  • $wgCirrusSearchIndexAllocation
  • $wgCirrusSearchNumCrossProjectSearchResults
  • $wgCirrusSearchLanguageDetectors
  • $wgCirrusSearchUpdateShardTimeout
  • $wgCirrusSearchEnableCrossProjectSearch
  • $wgCirrusSearchFullTextQueryBuilderProfiles
  • $wgCirrusSearchCompletionDefaultScore
  • $wgCirrusSearchWriteClusters
  • $wgCirrusSearchCompletionSuggesterHardLimit
  • $wgCirrusSearchRecycleCompletionSuggesterIndex
  • $wgCirrusSearchLogElasticRequests
  • $wgCirrusSearchConnectionAttempts
  • $wgCirrusSearchWikiToNameMap
  • $wgCirrusSearchMaxFullTextQueryLength
  • $wgCirrusSearchLogElasticRequestsSecret
  • $wgCirrusSearchEnableRegex
  • $wgCirrusSearchClientSideSearchTimeout
  • $wgCirrusSearchExtraBackendLatency
  • $wgCirrusSearchNamespaceMappings
  • $wgCirrusSearchWMFExtraFeatures
  • $wgCirrusSearchPreferRecentUnspecifiedDecayPortion
  • $wgCirrusSearchNamespaceResolutionMethod
  • $wgCirrusSearchCategoryMax
  • $wgCirrusSearchSearchShardTimeout
  • $wgCirrusSearchCategoryEndpoint
  • $wgCirrusSearchPrivateClusters
  • $wgCirrusSearchSimilarityProfiles
  • $wgCirrusSearchCrossProjectShowMultimedia
  • $wgCirrusSearchRefreshInterval
  • $wgCirrusSearchPoolCounterKey
  • $wgCirrusSearchCompletionProfiles
  • $wgCirrusSearchMaxShardsPerNode
  • $wgCirrusSearchEnableArchive
  • $wgCirrusSearchIndexDeletes
  • $wgCirrusSearchSimilarityProfile
  • $wgCirrusExploreSimilarResults
  • $wgCirrusSearchFiletypeAliases
  • $wgCirrusSearchDevelOptions
  • $wgCirrusSearchBoostTemplates
  • $wgCirrusSearchPrefixIds
  • $wgCirrusSearchPrefixSearchStartsWithAnyWord
  • $wgCirrusSearchUpdateConflictRetryCount
  • $wgCirrusSearchInterwikiHTTPTimeout
  • $wgCirrusSearchFetchConfigFromApi
  • $wgCirrusSearchFullTextQueryBuilderProfile
  • $wgCirrusSearchExtraIndexBoostTemplates
  • $wgCirrusSearchStripQuestionMarks
  • $wgCirrusSearchIndexBaseName
  • $wgCirrusSearchTextcatModel
  • $wgCirrusSearchMoreLikeThisFields
  • $wgCirrusSearchMasterTimeout
  • $wgCirrusSearchTextcatConfig
  • $wgCirrusSearchSanityCheck
  • $wgCirrusSearchInterwikiThreshold
  • $wgCirrusSearchNamespaceWeights
  • $wgCirrusSearchCrossProjectOrder
  • $wgCirrusSearchRescoreProfile
  • $wgCirrusSearchRescoreFunctionChains
  • $wgCirrusSearchMoreAccurateScoringMode
  • $wgCirrusSearchMaxPhraseTokens
  • $wgCirrusSearchCrossProjectSearchBlockList
  • $wgCirrusSearchCrossProjectProfiles
  • $wgCirrusSearchLanguageToWikiMap
  • $wgCirrusSearchMaxIncategoryOptions
  • $wgCirrusSearchEnableAltLanguage
  • $wgCirrusSearchWikimediaExtraPlugin
  • $wgCirrusSearchCompletionSuggesterUseDefaultSort
  • $wgCirrusSearchLinkedArticlesToUpdate
  • $wgCirrusSearchCompletionSuggesterSubphrases
  • $wgCirrusSearchPreferRecentDefaultHalfLife
  • $wgCirrusSearchEnablePhraseSuggest
  • $wgCirrusSearchFunctionRescoreWindowSize
  • $wgCirrusSearchPhraseSuggestUseOpeningText
  • $wgCirrusSearchCompletionSettings
  • $wgCirrusSearchUseExperimentalHighlighter
  • $wgCirrusSearchDropDelayedJobsAfter
  • $wgCirrusSearchFeedbackLink
  • $wgCirrusSearchUpdateDelay
  • $wgCirrusSearchInterleaveConfig
  • $wgCirrusSearchPhraseRescoreWindowSize
  • $wgCirrusSearchDefaultNamespaceWeight
  • $wgCirrusSearchMoreLikeThisAllowedFields
  • $wgCirrusSearchClientSideConnectTimeout
  • $wgCirrusSearchPhraseSuggestUseText
  • $wgCirrusSearchPhraseSuggestProfiles
  • $wgCirrusSearchPreferRecentDefaultDecayPortion
  • $wgCirrusSearchInterwikiSources
  • $wgCirrusSearchWeights
  • $wgCirrusSearchICUNormalizationUnicodeSetFilter
  • $wgCirrusSearchICUFoldingUnicodeSetFilter
  • $wgCirrusSearchSlowSearch
Hooks used
Hooks provided
Translate the CirrusSearch extension if it is available at translatewiki.net
Check usage and version matrix.
Vagrant rolecirrussearch
IssuesOpen tasks · Report a bug
The CirrusSearch extension implements searching for MediaWiki using Elasticsearch.
This page is for installation. After the install is working, see Help:CirrusSearch for usage.
Goals
Dependencies
PHP and cURL
In addition to the standard MediaWiki requirements for PHP, CirrusSearch requires PHP to be compiled with cURL support.
Elasticsearch
You will need to install Elasticsearch.
  • MediaWiki 1.29.x - 1.30.x require Elasticsearch 5.3.x - 5.4.x.
  • MediaWiki 1.31.x - 1.32.x require Elasticsearch 5.5.x - 5.6.x.
  • MediaWiki 1.33.x - 1.37.x require Elasticsearch 6.5.x - 6.8.x (6.5.4 recommended)
Take note that a Java installation like OpenJDK is needed in addition. It's best to use the official Elasticsearch Docker image or a self-hosted version. A managed product like Amazon OpenSearch (formerly Amazon Elasticsearch) can work but may require additional configuration depending on its specifics. For example, Amazon OpenSearch only listens for Elasticsearch API requests over HTTPS on port 443 (i.e. it does not expose the default Elasticsearch port 9200), so a TLS-enabled proxy (e.g. Nginx) can enable CirrusSearch to communicate with an Amazon OpenSearch cluster.
Elastica
Elastica is a PHP library to talk to Elasticsearch. Install Elastica per the instructions below.
Other
Due to the actual handling of jobs by the CirrusSearch extension, it is advisable to set up jobs in Redis to prevent messages like Notice: unserialize(): Error at offset 64870 of 65535 bytes in JobQueueDB.php and subsequent errors like Unsupported operand types. See task T157759.
Installation
Elastica
Even though the instructions below tell you to only run Composer when installing from git, it may be necessary to issue it anyway in order to install all PHP dependencies.
CirrusSearch
Upgrading
Please follow the upgrade instructions in the CirrusSearch UPGRADE file.
Configuration
The configuration parameters of CirrusSearch are documented at the "settings.txt" file. See also documentation on CirrusSearch configuration profiles.
Elasticsearch will fail to index for CirrusSearch if one is using a database name for MySQL which contains a capital character, e.g. "MyWikiDatabaseName". To mitigate this CirrusSearch provides the $wgCirrusSearchIndexBaseName configuration parameter which one needs to set, e.g. $wgCirrusSearchIndexBaseName = 'mywikidatabasename';​.
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. Searching happens via the normal search API, action=query&list=search​; you can use CirrusSearch-specific features, such as the morelike: special prefix to find pages related to Marie Curie and radium: api.php?action=query&list=search&srsearch=morelike:Marie_Curie%7Cradium&srlimit=10&srprop=size&formatversion=2 Custom APIs and parameters are provided for querying CirrusSearch configuration and debug information:
See also
General links
Debugging
How to determine that Cirrus is actually used as the search backend
Local development
Elastic Search service can be run with the Vagrant role (cirrussearch) and MediaWiki Vagrant.
For Docker, you can use a command like docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:6.8.2. Then follow the installation and configuration directions. If your web host is in a container you'll want to make sure the above container is on the same network, and in LocalSettings.php you will want to reference elasticsearch as the host name. This will not have the WMF plugins but can be sufficient for basic testing.
This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page.
Last edited on 6 October 2021, at 08:12
Content is available under CC BY-SA 3.0 unless otherwise noted.
Privacy policy
Terms of Use
Desktop
 Home Random Log in  Settings  Donate  About MediaWiki.org  Disclaimers
WatchEdit