MediaWiki  REL1_24
SearchResult Class Reference
Collaboration diagram for SearchResult:

List of all members.

Public Member Functions

 getByteSize ()
 getFile ()
 Get the file for this page, if one exists.
 getInterwikiNamespaceText ()
 getInterwikiPrefix ()
 getRedirectSnippet ()
 getRedirectTitle ()
 getSectionSnippet ()
 getSectionTitle ()
 getTextSnippet ($terms)
 getTimestamp ()
 getTitle ()
 getTitleSnippet ()
 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)
 Return a new SearchResult and initializes it with a title.

Protected Member Functions

 initFromTitle ($title)
 Initialize from a Title and if possible initializes a corresponding Revision and File.
 initText ()
 Lazy initialization of article text from DB.

Protected Attributes

File $mImage = null
Revision $mRevision = null
string $mText
Title $mTitle

Detailed Description

Todo:
FIXME: This class is horribly factored.

It would probably be better to have a useful base class to which you pass some standard information, then let the fancy self-highlighters extend that.

Definition at line 30 of file SearchResult.php.


Member Function Documentation

Returns:
int Size in bytes

Definition at line 207 of file SearchResult.php.

References initText().

Get the file for this page, if one exists.

Returns:
File|null

Definition at line 108 of file SearchResult.php.

Returns:
string Interwiki namespace of the title (since we likely can't resolve it locally)

Definition at line 222 of file SearchResult.php.

Returns:
string Interwiki prefix of the title (return iw even if title is broken)

Definition at line 215 of file SearchResult.php.

Returns:
string Highlighted redirect name (redirect to this page), '' if none or not supported

Definition at line 159 of file SearchResult.php.

Returns:
Title Title object for the redirect to this page, null if none or not supported

Definition at line 166 of file SearchResult.php.

Returns:
string Highlighted relevant section name, null if none or not supported

Definition at line 173 of file SearchResult.php.

Returns:
Title Title object (pagename+fragment) for the section, null if none or not supported

Definition at line 180 of file SearchResult.php.

Parameters:
array$termsTerms to highlight
Returns:
string Highlighted text snippet, null (and not '') if not supported

Definition at line 130 of file SearchResult.php.

Returns:
string Timestamp

Definition at line 187 of file SearchResult.php.

Returns:
Title

Definition at line 100 of file SearchResult.php.

Returns:
string Highlighted title, '' if not supported

Definition at line 152 of file SearchResult.php.

Returns:
int Number of words

Definition at line 199 of file SearchResult.php.

References initText().

SearchResult::initFromTitle ( title) [protected]

Initialize from a Title and if possible initializes a corresponding Revision and File.

Parameters:
Title$title

Definition at line 66 of file SearchResult.php.

SearchResult::initText ( ) [protected]

Lazy initialization of article text from DB.

Definition at line 115 of file SearchResult.php.

References SearchEngine\create().

Referenced by getByteSize(), and getWordCount().

Check if this is result points to an invalid title.

Returns:
bool

Definition at line 84 of file SearchResult.php.

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

Returns:
bool

Definition at line 230 of file SearchResult.php.

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

Returns:
bool

Definition at line 93 of file SearchResult.php.

static SearchResult::newFromTitle ( title) [static]

Return a new SearchResult and initializes it with a title.

Parameters:
Title$title
Returns:
SearchResult

Definition at line 54 of file SearchResult.php.

Referenced by SqlSearchResultSet\next(), and SearchNearMatchResultSet\next().


Member Data Documentation

File SearchResult::$mImage = null [protected]

Definition at line 38 of file SearchResult.php.

Revision SearchResult::$mRevision = null [protected]

Definition at line 34 of file SearchResult.php.

string SearchResult::$mText [protected]

Definition at line 46 of file SearchResult.php.

Title SearchResult::$mTitle [protected]

Definition at line 42 of file SearchResult.php.


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