19 protected $mRevisionRecord =
null;
45 $services = MediaWikiServices::getInstance();
49 $this->mRevisionRecord = $services->getRevisionLookup()->getRevisionByTitle(
52 RevisionLookup::READ_NORMAL
55 $this->mImage = $services->getRepoGroup()->findFile(
$title );
66 return $this->mTitle ===
null;
97 if ( !isset( $this->mText ) ) {
98 if ( $this->mRevisionRecord !=
null ) {
99 $content = $this->mRevisionRecord->getContent( SlotRecord::MAIN );
162 if ( $this->mRevisionRecord ) {
163 return $this->mRevisionRecord->getTimestamp();
164 } elseif ( $this->mImage ) {
165 return $this->mImage->getTimestamp();
175 return str_word_count( $this->mText );
183 return strlen( $this->mText );
isMissingRevision()
Check if target page is missing, happens when index is out of date.
getInterwikiNamespaceText()
getTextSnippet( $terms=[])
initFromTitle( $title)
Initialize from a Title and if possible initializes a corresponding RevisionRecord and File.
isFileMatch()
Did this match file contents (eg: PDF/DJVU)?
isBrokenTitle()
Check if this is result points to an invalid title.
trait RevisionSearchResultTrait
Transitional trait used to share the methods between SearchResult and RevisionSearchResult.
getFile()
Get the file for this page, if one exists.
initText()
Lazy initialization of article text from DB.
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.