MediaWiki master
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, TitleFactory $titleFactory)
 
 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 23 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,
TitleFactory $titleFactory )
Parameters
ServiceOptions$options
Language$contentLanguage
LanguageConverterFactory$languageConverterFactory
HookContainer$hookContainer
WikiPageFactory$wikiPageFactory
UserNameUtils$userNameUtils
RepoGroup$repoGroup
TitleFactory$titleFactory

Definition at line 81 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 110 of file TitleMatcher.php.

References 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 124 of file TitleMatcher.php.

References MediaWiki\Search\TitleMatcher\getNearMatch().


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