MediaWiki REL1_40
MediaWiki\Search\TitleMatcher Class Reference

Service implementation of near match title search. More...

Public Member Functions

 __construct (ServiceOptions $options, Language $contentLanguage, LanguageConverterFactory $languageConverterFactory, HookContainer $hookContainer, WikiPageFactory $wikiPageFactory, UserNameUtils $userNameUtils, RepoGroup $repoGroup)
 
 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.
 

Detailed Description

Service implementation of near match title search.

Definition at line 22 of file TitleMatcher.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Search\TitleMatcher::__construct ( ServiceOptions $options,
Language $contentLanguage,
LanguageConverterFactory $languageConverterFactory,
HookContainer $hookContainer,
WikiPageFactory $wikiPageFactory,
UserNameUtils $userNameUtils,
RepoGroup $repoGroup )
Parameters
ServiceOptions$options
Language$contentLanguage
LanguageConverterFactory$languageConverterFactory
HookContainer$hookContainer
WikiPageFactory$wikiPageFactory
UserNameUtils$userNameUtils
RepoGroup$repoGroup

Definition at line 77 of file TitleMatcher.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), and MediaWiki\Languages\LanguageConverterFactory\getLanguageConverter().

Member Function Documentation

◆ getNearMatch()

MediaWiki\Search\TitleMatcher::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 104 of file TitleMatcher.php.

References $title, and MediaWiki\Search\TitleMatcher\getNearMatchInternal().

Referenced by MediaWiki\Search\TitleMatcher\getNearMatchInternal(), and MediaWiki\Search\TitleMatcher\getNearMatchResultSet().

◆ getNearMatchInternal()

MediaWiki\Search\TitleMatcher::getNearMatchInternal ( $searchterm)
protected

◆ getNearMatchResultSet()

MediaWiki\Search\TitleMatcher::getNearMatchResultSet ( $searchterm)

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

Parameters
string$searchterm
Returns
ISearchResultSet

Definition at line 118 of file TitleMatcher.php.

References MediaWiki\Search\TitleMatcher\getNearMatch().


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