MediaWiki  REL1_22
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 748 of file SearchEngine.php.


Constructor & Destructor Documentation

SearchResult::__construct ( row = null)

Reimplemented in PostgresSearchResult.

Definition at line 786 of file SearchEngine.php.


Member Function Documentation

Returns:
Integer: size in bytes

Definition at line 949 of file SearchEngine.php.

References initText().

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

Definition at line 964 of file SearchEngine.php.

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

Definition at line 901 of file SearchEngine.php.

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

Definition at line 908 of file SearchEngine.php.

Returns:
float|null if not supported

Reimplemented in PostgresSearchResult.

Definition at line 853 of file SearchEngine.php.

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

Definition at line 915 of file SearchEngine.php.

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

Definition at line 922 of file SearchEngine.php.

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

Definition at line 875 of file SearchEngine.php.

Returns:
String: timestamp

Definition at line 929 of file SearchEngine.php.

Returns:
Title

Definition at line 846 of file SearchEngine.php.

Parameters:
array$termsterms to highlight
Returns:
String: highlighted title, '' if not supported

Definition at line 893 of file SearchEngine.php.

Returns:
Integer: number of words

Definition at line 941 of file SearchEngine.php.

References initText().

Returns:
Boolean if hit has related articles

Definition at line 957 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 799 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 809 of file SearchEngine.php.

SearchResult::initText ( ) [protected]

Lazy initialization of article text from DB.

Definition at line 860 of file SearchEngine.php.

References SearchEngine\create().

Referenced by getByteSize(), and getWordCount().

Check if this is result points to an invalid title.

Returns:
Boolean

Definition at line 827 of file SearchEngine.php.

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

Returns:
Boolean

Definition at line 839 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 780 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 769 of file SearchEngine.php.


Member Data Documentation

SearchResult::$mImage = null

Definition at line 753 of file SearchEngine.php.

Revision SearchResult::$mRevision = null

Definition at line 752 of file SearchEngine.php.

String SearchResult::$mText

Definition at line 761 of file SearchEngine.php.

Title SearchResult::$mTitle

Definition at line 757 of file SearchEngine.php.


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