MediaWiki  REL1_20
SearchResult Class Reference
Inheritance diagram for SearchResult:
Collaboration diagram for SearchResult:

List of all members.

Public Member Functions

 __construct ($row=null)
 getByteSize ()
 getInterwikiPrefix ()
 getRedirectSnippet ($terms)
 getRedirectTitle ()
 getScore ()
 getSectionSnippet ()
 getSectionTitle ()
 getTextSnippet ($terms)
 getTimestamp ()
 getTitle ()
 getTitleSnippet ($terms)
 getWordCount ()
 hasRelated ()
 isBrokenTitle ()
 Check if this is result points to an invalid title.
 isMissingRevision ()
 Check if target page is missing, happens when index is out of date.

Static Public Member Functions

static newFromRow ($row)
 Return a new SearchResult and initializes it with a row.
static newFromTitle ($title)
 Return a new SearchResult and initializes it with a title.

Public Attributes

 $mImage = null
Revision $mRevision = null
String $mText
Title $mTitle

Protected Member Functions

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

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 678 of file SearchEngine.php.


Constructor & Destructor Documentation

SearchResult::__construct ( row = null)

Reimplemented in PostgresSearchResult.

Definition at line 716 of file SearchEngine.php.


Member Function Documentation

Returns:
Integer: size in bytes

Definition at line 872 of file SearchEngine.php.

References initText().

Returns:
String: interwiki prefix of the title (return iw even if title is broken)

Definition at line 887 of file SearchEngine.php.

Parameters:
$termsArray: terms to highlight
Returns:
String: highlighted redirect name (redirect to this page), '' if none or not supported

Definition at line 825 of file SearchEngine.php.

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

Definition at line 832 of file SearchEngine.php.

Returns:
float|null if not supported

Reimplemented in PostgresSearchResult.

Definition at line 781 of file SearchEngine.php.

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

Definition at line 839 of file SearchEngine.php.

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

Definition at line 846 of file SearchEngine.php.

Parameters:
$termsArray: terms to highlight
Returns:
String: highlighted text snippet, null (and not '') if not supported

Definition at line 802 of file SearchEngine.php.

Returns:
String: timestamp

Definition at line 853 of file SearchEngine.php.

Returns:
Title

Definition at line 774 of file SearchEngine.php.

Parameters:
$termsArray: terms to highlight
Returns:
String: highlighted title, '' if not supported

Definition at line 817 of file SearchEngine.php.

Returns:
Integer: number of words

Definition at line 864 of file SearchEngine.php.

References initText().

Returns:
Boolean if hit has related articles

Definition at line 880 of file SearchEngine.php.

SearchResult::initFromRow ( row) [protected]

Initialize from a database row.

Makes a Title and passes that to initFromTitle.

Parameters:
$rowobject

Definition at line 729 of file SearchEngine.php.

SearchResult::initFromTitle ( title) [protected]

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

Parameters:
$titleTitle

Definition at line 739 of file SearchEngine.php.

SearchResult::initText ( ) [protected]

Lazy initialization of article text from DB.

Definition at line 788 of file SearchEngine.php.

Referenced by getByteSize(), and getWordCount().

Check if this is result points to an invalid title.

Returns:
Boolean

Definition at line 756 of file SearchEngine.php.

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

Returns:
Boolean

Definition at line 767 of file SearchEngine.php.

static SearchResult::newFromRow ( row) [static]

Return a new SearchResult and initializes it with a row.

Parameters:
$rowobject
Returns:
SearchResult

Definition at line 710 of file SearchEngine.php.

Referenced by SqlSearchResultSet\next().

static SearchResult::newFromTitle ( title) [static]

Return a new SearchResult and initializes it with a title.

Parameters:
$titleTitle
Returns:
SearchResult

Definition at line 699 of file SearchEngine.php.


Member Data Documentation

SearchResult::$mImage = null

Definition at line 683 of file SearchEngine.php.

Revision SearchResult::$mRevision = null

Definition at line 682 of file SearchEngine.php.

String SearchResult::$mText

Definition at line 691 of file SearchEngine.php.

Title SearchResult::$mTitle

Definition at line 687 of file SearchEngine.php.


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