Utility class build MW Title from elastica Result/ResultSet classes This class can be used in all classes that need to build a Title by reading the elasticsearch output.
More...
Utility class build MW Title from elastica Result/ResultSet classes This class can be used in all classes that need to build a Title by reading the elasticsearch output.
◆ __construct()
CirrusSearch\Search\TitleHelper::__construct |
( |
| $hostWikiID = null, |
|
|
?InterwikiResolver | $interwikiResolver = null, |
|
|
?callable | $linkSanitizer = null ) |
- Parameters
-
string | null | $hostWikiID | |
InterwikiResolver | null | $interwikiResolver | |
callable | null | $linkSanitizer | |
◆ getNamespaceText()
CirrusSearch\Search\TitleHelper::getNamespaceText |
( |
Title | $title | ) |
|
◆ isExternal()
CirrusSearch\Search\TitleHelper::isExternal |
( |
\Elastica\Result | $r | ) |
|
- Parameters
-
- Returns
- bool true if this result refers to an external Title
◆ makeRedirectTitle()
CirrusSearch\Search\TitleHelper::makeRedirectTitle |
( |
\Elastica\Result | $r, |
|
|
| $redirectText, |
|
|
| $redirNamespace ) |
Build a Title to a redirect, this always works for internal titles.
For external titles we need to use the namespace_text which is only valid if the redirect namespace is equals to the target title namespace. If the namespaces do not match we return null.
- Parameters
-
\Elastica\Result | $r | |
string | $redirectText | |
int | $redirNamespace | |
- Returns
- Title|null the Title to the Redirect or null if we can't build it
◆ makeTitle()
CirrusSearch\Search\TitleHelper::makeTitle |
( |
\Elastica\Result | $r | ) |
|
Create a title.
When making interwiki titles we should be providing the namespace text as a portion of the text, rather than a namespace id, because namespace id's are not consistent across wiki's. This additionally prevents the local wiki from localizing the namespace text when it should be using the localized name of the remote wiki.
- Parameters
-
\Elastica\Result | $r | int $namespace |
- Returns
- Title
◆ sanitizeSectionFragment()
CirrusSearch\Search\TitleHelper::sanitizeSectionFragment |
( |
| $id | ) |
|
The documentation for this class was generated from the following file:
- includes/Search/TitleHelper.php