42 $this->mTitle = $title;
53 $this->mTitle = $title;
54 if ( $title !==
null && $title->canExist() ) {
57 (
new HookRunner( $services->getHookContainer() ) )->onSearchResultInitFromTitle( $title, $id );
59 $this->mRevisionRecord = $services->getRevisionLookup()->getRevisionByTitle(
62 IDBAccessObject::READ_NORMAL
64 if ( $title->getNamespace() ===
NS_FILE ) {
65 $this->mImage = $services->getRepoGroup()->findFile( $title );
76 return $this->mTitle ===
null;
107 if ( $this->mText ===
null ) {
108 if ( $this->mRevisionRecord !=
null ) {
109 $content = $this->mRevisionRecord->getContent( SlotRecord::MAIN );
110 $this->mText = $content !==
null ? $content->getTextForSearchIndex() :
'';
172 if ( $this->mRevisionRecord ) {
173 return $this->mRevisionRecord->getTimestamp();
174 } elseif ( $this->mImage ) {
175 return $this->mImage->getTimestamp();
185 return str_word_count( $this->mText );
193 return strlen( $this->mText );
220class_alias( RevisionSearchResult::class,
'RevisionSearchResult' );