CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\SiteMatrixInterwikiResolver Class Reference

InterwikiResolver suited for WMF context and uses SiteMatrix. More...

+ Inheritance diagram for CirrusSearch\SiteMatrixInterwikiResolver:
+ Collaboration diagram for CirrusSearch\SiteMatrixInterwikiResolver:

Public Member Functions

 __construct (SearchConfig $config, MultiHttpClient $client, WANObjectCache $wanCache, InterwikiLookup $iwLookup)
 
- Public Member Functions inherited from CirrusSearch\BaseInterwikiResolver
 getSisterProjectPrefixes ()
 
 getSisterProjectConfigs ()
 
 getInterwikiPrefix ( $wikiId)
 
 getSameProjectWikiByLang ( $lang)
 
 getSameProjectConfigByLang ( $lang)
 

Static Public Member Functions

static accepts (SearchConfig $config, ?ExtensionRegistry $extensionRegistry=null)
 

Protected Member Functions

 loadMatrix ()
 Load the interwiki matric information The returned array must include the following keys:
 
- Protected Member Functions inherited from CirrusSearch\BaseInterwikiResolver
 minimalSearchConfig ( $wiki, array $hashConfigFlags)
 Minimal config needed to run a search on a target wiki living on the same cluster as the host wiki.
 

Additional Inherited Members

- Public Attributes inherited from CirrusSearch\InterwikiResolver
const SERVICE = 'CirrusSearchInterwikiresolver'
 @const string service name
 
- Protected Attributes inherited from CirrusSearch\BaseInterwikiResolver
SearchConfig $config
 
InterwikiLookup $interwikiLookup
 
WANObjectCache $wanCache
 

Detailed Description

InterwikiResolver suited for WMF context and uses SiteMatrix.

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\SiteMatrixInterwikiResolver::__construct ( SearchConfig $config,
MultiHttpClient $client,
WANObjectCache $wanCache,
InterwikiLookup $iwLookup )
Parameters
SearchConfig$config
MultiHttpClient$clienthttp client to fetch cirrus config
WANObjectCache$wanCacheCache object for caching repeated requests
InterwikiLookup$iwLookup

Reimplemented from CirrusSearch\BaseInterwikiResolver.

Member Function Documentation

◆ accepts()

static CirrusSearch\SiteMatrixInterwikiResolver::accepts ( SearchConfig $config,
?ExtensionRegistry $extensionRegistry = null )
static
Parameters
SearchConfig$config
ExtensionRegistry | null$extensionRegistry
Returns
bool true if this resolver can run with the specified config

◆ loadMatrix()

CirrusSearch\SiteMatrixInterwikiResolver::loadMatrix ( )
protected

Load the interwiki matric information The returned array must include the following keys:

  • sister_projects: an array with the list of sister wikis indexed by interwiki prefix
  • cross_language: an array with the list of wikis running the same project/site indexed by interwiki prefix
  • language_map: an array with the list of interwiki prefixes where where the language code of the wiki does not match the prefix
  • prefixes_by_wiki: an array with the list of interwiki indexed by wikiID

The result of this method is stored in the current InterwikiResolver instance so it can be called only once per request.

return array[]

Reimplemented from CirrusSearch\BaseInterwikiResolver.


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