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)
 
 onGetPreferences ( $user, &$prefs)
 @inheritDoc
 
 onUserGetDefaultOptions (&$defaultOptions)
 @inheritDoc
 

Static Public Member Functions

static onBeforeInitialize ( $title, $unused, $outputPage, $user, $request, $mediaWiki)
 Hooked to call initialize after the user is set up.
 
static onApiBeforeMain ( $apiMain)
 Hooked to call initialize after the user is set up.
 
static initializeForRequest (WebRequest $request)
 Initializes the portions of Cirrus that require the $request to be fully initialized.
 
static onSoftwareInfo (&$software)
 Hook called to include Elasticsearch version info on Special:Version.
 
static onSpecialSearchResultsAppend ( $specialSearch, $out, $term)
 
static onPrefixSearchExtractNamespace (&$namespaces, &$search)
 Extract namespaces from query string.
 
static prefixSearchExtractNamespaceWithConnection (Connection $connection, &$namespaces, &$search)
 
static onSearchGetNearMatch ( $term, &$titleResult)
 Let Elasticsearch take a crack at getting near matches once mediawiki has tried all kinds of variants.
 
static onResourceLoaderGetConfigVars (&$vars)
 ResourceLoaderGetConfigVars hook handler This should be used for variables which vary with the html and for variables this should work cross skin.
 
static onShowSearchHitTitle (Title $title, &$text, $result, $terms, $page, &$query=[])
 Add $wgCirrusSearchInterwikiProv to external results.
 
static onAPIAfterExecute ( $module)
 
static onSpecialSearchResults ( $term, $titleMatches, $textMatches)
 
static onSpecialStatsAddExtra (&$extraStats, $context)
 
static onAPIQuerySiteInfoStatisticsInfo (&$extraStats)
 

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

◆ 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()

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

◆ onApiBeforeMain()

static CirrusSearch\Hooks::onApiBeforeMain ( $apiMain)
static

Hooked to call initialize after the user is set up.

Parameters
ApiMain$apiMainThe ApiMain instance being used

◆ onBeforeInitialize()

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

Hooked to call initialize after the user is set up.

Parameters
Title$title
\Article$unused
OutputPage$outputPage
User$user
\WebRequest$request
\MediaWiki$mediaWiki

◆ onPrefixSearchExtractNamespace()

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

Extract namespaces from query string.

Parameters
array&$namespaces
string&$search
Returns
bool

◆ onResourceLoaderGetConfigVars()

static CirrusSearch\Hooks::onResourceLoaderGetConfigVars ( & $vars)
static

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

◆ onSearchGetNearMatch()

static CirrusSearch\Hooks::onSearchGetNearMatch ( $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

◆ onShowSearchHitTitle()

static CirrusSearch\Hooks::onShowSearchHitTitle ( Title $title,
& $text,
$result,
$terms,
$page,
& $query = [] )
static

Add $wgCirrusSearchInterwikiProv to external results.

Parameters
Title$title
mixed&$text
mixed$result
mixed$terms
mixed$page
array&$query

◆ onSoftwareInfo()

static CirrusSearch\Hooks::onSoftwareInfo ( & $software)
static

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

Parameters
array&$softwareArray of wikitext and version numbers

◆ onSpecialSearchResults()

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

◆ onSpecialSearchResultsAppend()

static CirrusSearch\Hooks::onSpecialSearchResultsAppend ( $specialSearch,
$out,
$term )
static
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: