CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\InterwikiResolver Interface Reference

Retrieve Interwiki information. More...

+ Inheritance diagram for CirrusSearch\InterwikiResolver:

Public Member Functions

 getSisterProjectPrefixes ()
 
 getSisterProjectConfigs ()
 
 getInterwikiPrefix ( $wikiId)
 
 getSameProjectWikiByLang ( $lang)
 Determine the proper interwiki_prefix <=> wikiId pair for a given language code.
 
 getSameProjectConfigByLang ( $lang)
 Fetch the config of the wiki identified by this language code.
 

Public Attributes

const SERVICE = 'CirrusSearchInterwikiresolver'
 @const string service name
 

Detailed Description

Retrieve Interwiki information.

Designed to support CirrusSearch usecase:

  • getSisterProjectPrefixes(): same lang different project
  • getSameProjectWikiByLang(): same project different lang
  • getInterwikiPrefix(): retrieve the interwiki prefix from a wikiId

Member Function Documentation

◆ getInterwikiPrefix()

CirrusSearch\InterwikiResolver::getInterwikiPrefix ( $wikiId)
Parameters
string$wikiId
Returns
string|null the interwiki identified for this $wikiId or null if none found

Implemented in CirrusSearch\BaseInterwikiResolver, and CirrusSearch\EmptyInterwikiResolver.

◆ getSameProjectConfigByLang()

CirrusSearch\InterwikiResolver::getSameProjectConfigByLang ( $lang)

Fetch the config of the wiki identified by this language code.

Parameters
string$lang
Returns
SearchConfig[] zero or one element array: [] or [ interwiki => SearchConfig ]

Implemented in CirrusSearch\BaseInterwikiResolver, and CirrusSearch\EmptyInterwikiResolver.

◆ getSameProjectWikiByLang()

CirrusSearch\InterwikiResolver::getSameProjectWikiByLang ( $lang)

Determine the proper interwiki_prefix <=> wikiId pair for a given language code.

Most the time the language code is equals to interwiki prefix but in some rarer cases it's not true. Always use the interwiki prefix returned by this function to generate crosslanguage interwiki links.

Parameters
string$lang
Returns
string[] a two elt array ['wikiId', 'iwPrefix'] or [] if none found

Implemented in CirrusSearch\BaseInterwikiResolver, and CirrusSearch\EmptyInterwikiResolver.

◆ getSisterProjectConfigs()

CirrusSearch\InterwikiResolver::getSisterProjectConfigs ( )
Returns
SearchConfig[] configs of sister projects indexed by interwiki prefix

Implemented in CirrusSearch\BaseInterwikiResolver, and CirrusSearch\EmptyInterwikiResolver.

◆ getSisterProjectPrefixes()

CirrusSearch\InterwikiResolver::getSisterProjectPrefixes ( )
Returns
string[] of wikiIds indexed by interwiki prefix

Implemented in CirrusSearch\BaseInterwikiResolver, and CirrusSearch\EmptyInterwikiResolver.


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