MediaWiki REL1_37
SearchNearMatcher Class Reference

Implementation of near match title search. More...

Collaboration diagram for SearchNearMatcher:

Public Member Functions

 __construct (Config $config, Language $lang, HookContainer $hookContainer)
 
 getNearMatch ( $searchterm)
 If an exact title match can be found, or a very slightly close match, return the title.
 
 getNearMatchResultSet ( $searchterm)
 Do a near match (see SearchEngine::getNearMatch) and wrap it into a ISearchResultSet.
 

Protected Member Functions

 getNearMatchInternal ( $searchterm)
 Really find the title match.
 

Protected Attributes

Config $config
 

Private Attributes

HookRunner $hookRunner
 
Language $language
 Current language.
 
ILanguageConverter $languageConverter
 Current language converter.
 
UserNameUtils $userNameUtils
 
WikiPageFactory $wikiPageFactory
 

Detailed Description

Implementation of near match title search.

TODO: split into service/implementation.

Definition at line 13 of file SearchNearMatcher.php.

Constructor & Destructor Documentation

◆ __construct()

SearchNearMatcher::__construct ( Config  $config,
Language  $lang,
HookContainer  $hookContainer 
)
Parameters
Config$config
Language$lang
HookContainer$hookContainer

Definition at line 51 of file SearchNearMatcher.php.

References $config, and $lang.

Member Function Documentation

◆ getNearMatch()

SearchNearMatcher::getNearMatch (   $searchterm)

If an exact title match can be found, or a very slightly close match, return the title.

If no match, returns NULL.

Parameters
string$searchterm
Returns
Title

Definition at line 69 of file SearchNearMatcher.php.

References $title, and getNearMatchInternal().

Referenced by getNearMatchInternal(), and getNearMatchResultSet().

◆ getNearMatchInternal()

SearchNearMatcher::getNearMatchInternal (   $searchterm)
protected

Really find the title match.

Parameters
string$searchterm
Returns
null|Title

Definition at line 92 of file SearchNearMatcher.php.

References $matches, $title, getNearMatch(), SpecialPage\getTitleFor(), NS_FILE, NS_MEDIA, NS_MEDIAWIKI, and NS_USER.

Referenced by getNearMatch().

◆ getNearMatchResultSet()

SearchNearMatcher::getNearMatchResultSet (   $searchterm)

Do a near match (see SearchEngine::getNearMatch) and wrap it into a ISearchResultSet.

Parameters
string$searchterm
Returns
ISearchResultSet

Definition at line 83 of file SearchNearMatcher.php.

References getNearMatch().

Member Data Documentation

◆ $config

Config SearchNearMatcher::$config
protected

Definition at line 17 of file SearchNearMatcher.php.

Referenced by __construct().

◆ $hookRunner

HookRunner SearchNearMatcher::$hookRunner
private

Definition at line 34 of file SearchNearMatcher.php.

◆ $language

Language SearchNearMatcher::$language
private

Current language.

Definition at line 23 of file SearchNearMatcher.php.

◆ $languageConverter

ILanguageConverter SearchNearMatcher::$languageConverter
private

Current language converter.

Definition at line 29 of file SearchNearMatcher.php.

◆ $userNameUtils

UserNameUtils SearchNearMatcher::$userNameUtils
private

Definition at line 44 of file SearchNearMatcher.php.

◆ $wikiPageFactory

WikiPageFactory SearchNearMatcher::$wikiPageFactory
private

Definition at line 39 of file SearchNearMatcher.php.


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