CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Hooks Class Reference

All CirrusSearch's external hooks. More...

+ Inheritance diagram for CirrusSearch\Hooks:
+ Collaboration diagram for CirrusSearch\Hooks:

Public Member Functions

 __construct (ConfigFactory $configFactory)
 
 onBeforeInitialize ( $title, $unused, $outputPage, $user, $request, $mediaWiki)
 Hooked to call initialize after the user is set up.
 
 onApiBeforeMain (&$apiMain)
 Hooked to call initialize after the user is set up.
 
 onSoftwareInfo (&$software)
 Hook called to include Elasticsearch version info on Special:Version.
 
 onSpecialSearchResultsAppend ( $specialSearch, $out, $term)
 
 onPrefixSearchExtractNamespace (&$namespaces, &$search)
 Extract namespaces from query string.
 
 onSearchGetNearMatch ( $term, &$titleResult)
 
 onResourceLoaderGetConfigVars (array &$vars, $skin, Config $config)
 ResourceLoaderGetConfigVars hook handler This should be used for variables which vary with the html and for variables this should work cross skin.
 
 onShowSearchHitTitle (&$title, &$text, $result, $terms, $page, &$query, &$attributes)
 Add $wgCirrusSearchInterwikiProv to external results.
 
 onAPIAfterExecute ( $module)
 
 onSpecialSearchResults ( $term, &$titleMatches, &$textMatches)
 
 onGetPreferences ( $user, &$prefs)
 @inheritDoc
 
 onUserGetDefaultOptions (&$defaultOptions)
 @inheritDoc
 
 onSpecialStatsAddExtra (&$extraStats, $context)
 
 onAPIQuerySiteInfoStatisticsInfo (&$extraStats)
 

Static Public Member Functions

static initializeForRequest (WebRequest $request)
 Initializes the portions of Cirrus that require the $request to be fully initialized.
 
static prefixSearchExtractNamespaceWithConnection (Connection $connection, &$namespaces, &$search)
 
static handleSearchGetNearMatch ( $term, &$titleResult)
 Let Elasticsearch take a crack at getting near matches once mediawiki has tried all kinds of variants.
 

Detailed Description

All CirrusSearch's external hooks.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Hooks::__construct ( ConfigFactory $configFactory)
Parameters
ConfigFactory$configFactory

Member Function Documentation

◆ handleSearchGetNearMatch()

static CirrusSearch\Hooks::handleSearchGetNearMatch ( $term,
& $titleResult )
static

Let Elasticsearch take a crack at getting near matches once mediawiki has tried all kinds of variants.

Parameters
string$termthe original search term and all language variants
null | Title&$titleResultresulting match. A Title if we found something, unchanged otherwise.
Returns
bool return false if we find something, true otherwise so mediawiki can try its default behavior

◆ initializeForRequest()

static CirrusSearch\Hooks::initializeForRequest ( WebRequest $request)
static

Initializes the portions of Cirrus that require the $request to be fully initialized.

Parameters
WebRequest$request

◆ onAPIAfterExecute()

CirrusSearch\Hooks::onAPIAfterExecute ( $module)
Parameters
ApiBase$module

◆ onApiBeforeMain()

CirrusSearch\Hooks::onApiBeforeMain ( & $apiMain)

Hooked to call initialize after the user is set up.

Parameters
ApiMain&$apiMainThe ApiMain instance being used

◆ onBeforeInitialize()

CirrusSearch\Hooks::onBeforeInitialize ( $title,
$unused,
$outputPage,
$user,
$request,
$mediaWiki )

Hooked to call initialize after the user is set up.

Parameters
Title$title
null$unused
OutputPage$outputPage
User$user
WebRequest$request
ActionEntryPoint$mediaWiki

◆ onPrefixSearchExtractNamespace()

CirrusSearch\Hooks::onPrefixSearchExtractNamespace ( & $namespaces,
& $search )

Extract namespaces from query string.

Parameters
array&$namespaces
string&$search
Returns
bool

◆ onResourceLoaderGetConfigVars()

CirrusSearch\Hooks::onResourceLoaderGetConfigVars ( array & $vars,
$skin,
Config $config )

ResourceLoaderGetConfigVars hook handler This should be used for variables which vary with the html and for variables this should work cross skin.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars
Parameters
array&$vars
string$skin
Config$config

◆ onShowSearchHitTitle()

CirrusSearch\Hooks::onShowSearchHitTitle ( & $title,
& $text,
$result,
$terms,
$page,
& $query,
& $attributes )

Add $wgCirrusSearchInterwikiProv to external results.

Parameters
Title&$title
string | HtmlArmor | null&$text
SearchResult$result
array$terms
SpecialSearch$page
string[]&$query
string[]&$attributes

◆ onSoftwareInfo()

CirrusSearch\Hooks::onSoftwareInfo ( & $software)

Hook called to include Elasticsearch version info on Special:Version.

Parameters
array&$softwareArray of wikitext and version numbers

◆ onSpecialSearchResults()

CirrusSearch\Hooks::onSpecialSearchResults ( $term,
& $titleMatches,
& $textMatches )
Parameters
string$term
ISearchResultSet | null&$titleMatches
ISearchResultSet | null&$textMatches

◆ onSpecialSearchResultsAppend()

CirrusSearch\Hooks::onSpecialSearchResultsAppend ( $specialSearch,
$out,
$term )
Parameters
SpecialSearch$specialSearch
OutputPage$out
string$term

◆ prefixSearchExtractNamespaceWithConnection()

static CirrusSearch\Hooks::prefixSearchExtractNamespaceWithConnection ( Connection $connection,
& $namespaces,
& $search )
static
Parameters
Connection$connection
array&$namespaces
string&$search
Returns
false

The documentation for this class was generated from the following file: