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

InterwikiResolver suited for custom cirrus config: More...

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

Static Public Member Functions

static accepts (SearchConfig $config)
 

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 Member Functions inherited from CirrusSearch\BaseInterwikiResolver
 __construct (SearchConfig $config, MultiHttpClient $client, WANObjectCache $wanCache, InterwikiLookup $iwLookup)
 
 getSisterProjectPrefixes ()
 
 getSisterProjectConfigs ()
 
 getInterwikiPrefix ( $wikiId)
 
 getSameProjectWikiByLang ( $lang)
 
 getSameProjectConfigByLang ( $lang)
 
- 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 custom cirrus config:

  • wgCirrusSearchLanguageToWikiMap: a map of language code to wiki db prefixes
  • wgCirrusSearchInterwikiSources: a map of cross project interwiki prefixes to wikiId
  • wgCirrusSearchWikiToNameMap: a map of language interwiki prefixes to wikiId

Member Function Documentation

◆ accepts()

static CirrusSearch\CirrusConfigInterwikiResolver::accepts ( SearchConfig $config)
static
Parameters
SearchConfig$config
Returns
bool true if this resolver can run with the specified config

◆ loadMatrix()

CirrusSearch\CirrusConfigInterwikiResolver::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: