MediaWiki master
MediaWiki\Search\SearchResult Class Reference

An abstract base class representing a search engine result. More...

Inherited by MediaWiki\Search\RevisionSearchResult.

Public Member Functions

 getByteSize ()
 
 getCategorySnippet ()
 
 getCategorySnippetField ()
 
 getFile ()
 Get the file for this page, if one exists.
 
 getInterwikiNamespaceText ()
 
 getInterwikiPrefix ()
 
 getRedirectSnippet ()
 
 getRedirectSnippetField ()
 
 getRedirectTitle ()
 
 getSectionSnippet ()
 
 getSectionSnippetField ()
 
 getSectionTitle ()
 
 getTextSnippet ( $terms=[])
 
 getTextSnippetField ()
 
 getTimestamp ()
 
 getTitle ()
 
 getTitleSnippet ()
 
 getTitleSnippetField ()
 
 getWordCount ()
 
 isBrokenTitle ()
 Check if this is result points to an invalid title.
 
 isFileMatch ()
 Did this match file contents (eg: PDF/DJVU)?
 
 isMissingRevision ()
 Check if target page is missing, happens when index is out of date.
 

Static Public Member Functions

static newFromTitle ( $title, ?ISearchResultSet $parentSet=null)
 Return a new SearchResult and initializes it with a title.
 

Detailed Description

An abstract base class representing a search engine result.

Definition at line 18 of file SearchResult.php.

Member Function Documentation

◆ getByteSize()

MediaWiki\Search\SearchResult::getByteSize ( )
abstract

◆ getCategorySnippet()

MediaWiki\Search\SearchResult::getCategorySnippet ( )
abstract
Returns
string Highlighted relevant category name or '' if none or not supported

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateCategoryHtml().

◆ getCategorySnippetField()

MediaWiki\Search\SearchResult::getCategorySnippetField ( )
Returns
string Name of the field containing the category snippet, '' if not supported

Definition at line 129 of file SearchResult.php.

◆ getFile()

MediaWiki\Search\SearchResult::getFile ( )
abstract

Get the file for this page, if one exists.

Returns
File|null

Reimplemented in MediaWiki\Search\RevisionSearchResult.

◆ getInterwikiNamespaceText()

MediaWiki\Search\SearchResult::getInterwikiNamespaceText ( )
abstract
Returns
string Interwiki namespace of the title (since we likely can't resolve it locally)

Reimplemented in MediaWiki\Search\RevisionSearchResult.

◆ getInterwikiPrefix()

MediaWiki\Search\SearchResult::getInterwikiPrefix ( )
abstract
Returns
string Interwiki prefix of the title (return iw even if title is broken)

Reimplemented in MediaWiki\Search\RevisionSearchResult.

◆ getRedirectSnippet()

MediaWiki\Search\SearchResult::getRedirectSnippet ( )
abstract
Returns
string Highlighted redirect name (redirect to this page), '' if none or not supported

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateRedirectHtml(), and MediaWiki\Search\SearchWidgets\InterwikiSearchResultWidget\render().

◆ getRedirectSnippetField()

MediaWiki\Search\SearchResult::getRedirectSnippetField ( )
Returns
string Name of the field containing the redirect snippet, '' if not supported

Definition at line 94 of file SearchResult.php.

◆ getRedirectTitle()

MediaWiki\Search\SearchResult::getRedirectTitle ( )
abstract
Returns
Title|null Title object for the redirect to this page, null if none or not supported

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateRedirectHtml(), and MediaWiki\Search\SearchWidgets\InterwikiSearchResultWidget\render().

◆ getSectionSnippet()

MediaWiki\Search\SearchResult::getSectionSnippet ( )
abstract
Returns
string Highlighted relevant section name, null if none or not supported

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateSectionHtml().

◆ getSectionSnippetField()

MediaWiki\Search\SearchResult::getSectionSnippetField ( )
Returns
string Name of the field containing the section snippet, '' if not supported

Definition at line 111 of file SearchResult.php.

◆ getSectionTitle()

MediaWiki\Search\SearchResult::getSectionTitle ( )
abstract
Returns
Title|null Title object (pagename+fragment) for the section, null if none or not supported

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateSectionHtml().

◆ getTextSnippet()

MediaWiki\Search\SearchResult::getTextSnippet ( $terms = [])
abstract
Parameters
string[]$termsTerms to highlight (this parameter is deprecated and ignored)
Returns
string Highlighted text snippet, null (and not '') if not supported

Reimplemented in MediaWiki\Search\RevisionSearchResult, and MediaWiki\Search\SqlSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\render(), and MediaWiki\Search\SearchWidgets\InterwikiSearchResultWidget\render().

◆ getTextSnippetField()

MediaWiki\Search\SearchResult::getTextSnippetField ( )
Returns
string Name of the field containing the text snippet, '' if not supported

Definition at line 70 of file SearchResult.php.

◆ getTimestamp()

MediaWiki\Search\SearchResult::getTimestamp ( )
abstract

◆ getTitle()

◆ getTitleSnippet()

MediaWiki\Search\SearchResult::getTitleSnippet ( )
abstract

◆ getTitleSnippetField()

MediaWiki\Search\SearchResult::getTitleSnippetField ( )
Returns
string Name of the field containing the title snippet, '' if not supported

Definition at line 82 of file SearchResult.php.

◆ getWordCount()

MediaWiki\Search\SearchResult::getWordCount ( )
abstract

◆ isBrokenTitle()

MediaWiki\Search\SearchResult::isBrokenTitle ( )
abstract

Check if this is result points to an invalid title.

Returns
bool

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\render().

◆ isFileMatch()

MediaWiki\Search\SearchResult::isFileMatch ( )
abstract

Did this match file contents (eg: PDF/DJVU)?

Returns
bool

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateFileHtml().

◆ isMissingRevision()

MediaWiki\Search\SearchResult::isMissingRevision ( )
abstract

Check if target page is missing, happens when index is out of date.

Returns
bool

Reimplemented in MediaWiki\Search\RevisionSearchResult.

Referenced by MediaWiki\Search\SearchWidgets\FullSearchResultWidget\render().

◆ newFromTitle()

static MediaWiki\Search\SearchResult::newFromTitle ( $title,
?ISearchResultSet $parentSet = null )
static

Return a new SearchResult and initializes it with a title.

Parameters
Title$title
ISearchResultSet | null$parentSet
Returns
SearchResult

Definition at line 28 of file SearchResult.php.

Referenced by MediaWiki\Search\SearchNearMatchResultSet\__construct().


The documentation for this class was generated from the following file: