MediaWiki  1.32.5
SearchNearMatcher Class Reference

Implementation of near match title search. More...

Collaboration diagram for SearchNearMatcher:

Public Member Functions

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

Protected Member Functions

 getNearMatchInternal ( $searchterm)
 Really find the title match. More...
 

Protected Attributes

Config $config
 

Private Attributes

Language $language
 Current language. More...
 

Detailed Description

Implementation of near match title search.

TODO: split into service/implementation.

Definition at line 7 of file SearchNearMatcher.php.

Constructor & Destructor Documentation

◆ __construct()

SearchNearMatcher::__construct ( Config  $config,
Language  $lang 
)

Definition at line 19 of file SearchNearMatcher.php.

References $config, $lang, and language().

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 31 of file SearchNearMatcher.php.

References $title, getNearMatchInternal(), and Hooks\run().

Referenced by getNearMatchInternal(), and getNearMatchResultSet().

◆ getNearMatchInternal()

SearchNearMatcher::getNearMatchInternal (   $searchterm)
protected

Really find the title match.

Parameters
string$searchterm
Returns
null|Title

Definition at line 54 of file SearchNearMatcher.php.

References $image, $lang, $language, $matches, $term, $title, as, WikiPage\factory(), getNearMatch(), SpecialPage\getTitleFor(), User\isIP(), Title\makeTitle(), Title\newFromText(), NS_FILE, NS_MEDIA, NS_MEDIAWIKI, NS_USER, Hooks\run(), and wfFindFile().

Referenced by getNearMatch().

◆ getNearMatchResultSet()

SearchNearMatcher::getNearMatchResultSet (   $searchterm)

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

Parameters
string$searchterm
Returns
SearchResultSet

Definition at line 45 of file SearchNearMatcher.php.

References getNearMatch().

Member Data Documentation

◆ $config

Config SearchNearMatcher::$config
protected

Definition at line 11 of file SearchNearMatcher.php.

Referenced by __construct().

◆ $language

Language SearchNearMatcher::$language
private

Current language.

Definition at line 17 of file SearchNearMatcher.php.

Referenced by getNearMatchInternal().


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