|
MediaWiki master
|
A search suggestion. More...
Public Member Functions | |
| __construct ( $score, $text=null, ?Title $suggestedTitle=null, $suggestedTitleID=null) | |
| getScore () | |
| Suggestion score. | |
| getSuggestedTitle () | |
| Title object in the case this suggestion is based on a title. | |
| getSuggestedTitleID () | |
| Title ID in the case this suggestion is based on a title. | |
| getText () | |
| The suggestion text. | |
| getURL () | |
| Suggestion URL, can be the link to the Title or maybe in the future a link to the search results for this search suggestion. | |
| setScore ( $score) | |
| Set the suggestion score. | |
| setSuggestedTitle (?Title $title=null) | |
| setSuggestedTitleID ( $suggestedTitleID=null) | |
| setText ( $text, $setTitle=true) | |
| Set the suggestion text. | |
| setURL ( $url) | |
| Set the suggestion URL. | |
Static Public Member Functions | |
| static | fromText ( $score, $text) |
| Create suggestion from text Will also create a title if text if not empty. | |
| static | fromTitle ( $score, Title $title) |
| Create suggestion from Title. | |
A search suggestion.
Definition at line 16 of file SearchSuggestion.php.
| MediaWiki\Search\SearchSuggestion::__construct | ( | $score, | |
| $text = null, | |||
| ?Title | $suggestedTitle = null, | ||
| $suggestedTitleID = null ) |
| float | $score | the suggestion score |
| string | null | $text | the suggestion text |
| Title | null | $suggestedTitle | |
| int | null | $suggestedTitleID |
Definition at line 50 of file SearchSuggestion.php.
References MediaWiki\Search\SearchSuggestion\setSuggestedTitle().
|
static |
Create suggestion from text Will also create a title if text if not empty.
| float | $score | Suggestions score |
| string | $text |
Definition at line 166 of file SearchSuggestion.php.
|
static |
Create suggestion from Title.
| float | $score | Suggestions score |
| Title | $title |
Definition at line 155 of file SearchSuggestion.php.
References MediaWiki\Title\Title\getArticleID(), and MediaWiki\Title\Title\getPrefixedText().
Referenced by MediaWiki\Search\SearchEngine\processCompletionResults().
| MediaWiki\Search\SearchSuggestion::getScore | ( | ) |
Suggestion score.
Definition at line 120 of file SearchSuggestion.php.
Referenced by MediaWiki\Search\SearchSuggestionSet\append(), and MediaWiki\Search\SearchSuggestionSet\prepend().
| MediaWiki\Search\SearchSuggestion::getSuggestedTitle | ( | ) |
Title object in the case this suggestion is based on a title.
May return null if the suggestion is not a Title.
Definition at line 85 of file SearchSuggestion.php.
Referenced by MediaWiki\Search\SearchEngine\extractTitles(), and MediaWiki\Search\SearchEngine\processCompletionResults().
| MediaWiki\Search\SearchSuggestion::getSuggestedTitleID | ( | ) |
Title ID in the case this suggestion is based on a title.
May return null if the suggestion is not a Title.
Definition at line 105 of file SearchSuggestion.php.
Referenced by MediaWiki\Search\SearchSuggestionSet\append(), and MediaWiki\Search\SearchSuggestionSet\prepend().
| MediaWiki\Search\SearchSuggestion::getText | ( | ) |
| MediaWiki\Search\SearchSuggestion::getURL | ( | ) |
Suggestion URL, can be the link to the Title or maybe in the future a link to the search results for this search suggestion.
Definition at line 137 of file SearchSuggestion.php.
| MediaWiki\Search\SearchSuggestion::setScore | ( | $score | ) |
Set the suggestion score.
| float | $score |
Definition at line 128 of file SearchSuggestion.php.
Referenced by MediaWiki\Search\SearchSuggestionSet\append(), and MediaWiki\Search\SearchSuggestionSet\prepend().
| MediaWiki\Search\SearchSuggestion::setSuggestedTitle | ( | ?Title | $title = null | ) |
| Title | null | $title |
Definition at line 92 of file SearchSuggestion.php.
References MediaWiki\MediaWikiServices\getInstance(), and PROTO_CURRENT.
Referenced by MediaWiki\Search\SearchSuggestion\__construct(), and MediaWiki\Search\SearchSuggestion\setText().
| MediaWiki\Search\SearchSuggestion::setSuggestedTitleID | ( | $suggestedTitleID = null | ) |
| int | null | $suggestedTitleID |
Definition at line 112 of file SearchSuggestion.php.
| MediaWiki\Search\SearchSuggestion::setText | ( | $text, | |
| $setTitle = true ) |
Set the suggestion text.
| string | $text | |
| bool | $setTitle | Should we also update the title? |
Definition at line 73 of file SearchSuggestion.php.
References MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\makeTitle(), and MediaWiki\Search\SearchSuggestion\setSuggestedTitle().
| MediaWiki\Search\SearchSuggestion::setURL | ( | $url | ) |
Set the suggestion URL.
| string | $url |
Definition at line 145 of file SearchSuggestion.php.
References $url.