MediaWiki  REL1_19
SearchResult Class Reference
Inheritance 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
 $mRevision = null
 $mText
 $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 673 of file SearchEngine.php.


Constructor & Destructor Documentation

SearchResult::__construct ( row = null)

Reimplemented in PostgresSearchResult.

Definition at line 714 of file SearchEngine.php.

References initFromRow().

Here is the call graph for this function:


Member Function Documentation

Returns:
Integer: size in bytes

Definition at line 867 of file SearchEngine.php.

References initText().

Here is the call graph for this function:

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

Definition at line 882 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 820 of file SearchEngine.php.

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

Definition at line 827 of file SearchEngine.php.

Returns:
Double or null if not supported

Reimplemented in PostgresSearchResult.

Definition at line 776 of file SearchEngine.php.

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

Definition at line 834 of file SearchEngine.php.

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

Definition at line 841 of file SearchEngine.php.

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

Definition at line 797 of file SearchEngine.php.

References $wgAdvancedSearchHighlighting, $wgUser, initText(), and SearchEngine\userHighlightPrefs().

Here is the call graph for this function:

Returns:
String: timestamp

Definition at line 848 of file SearchEngine.php.

Returns:
Title

Definition at line 769 of file SearchEngine.php.

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

Definition at line 812 of file SearchEngine.php.

Returns:
Integer: number of words

Definition at line 859 of file SearchEngine.php.

References initText().

Here is the call graph for this function:

Returns:
Boolean if hit has related articles

Definition at line 875 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 727 of file SearchEngine.php.

References initFromTitle(), and Title\makeTitle().

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

SearchResult::initFromTitle ( title) [protected]

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

Parameters:
$titleTitle

Definition at line 737 of file SearchEngine.php.

References $title, newFromTitle(), and wfFindFile().

Referenced by initFromRow().

Here is the call graph for this function:

Here is the caller graph for this function:

SearchResult::initText ( ) [protected]

Lazy initialization of article text from DB.

Definition at line 783 of file SearchEngine.php.

Referenced by getByteSize(), getTextSnippet(), and getWordCount().

Here is the caller graph for this function:

Check if this is result points to an invalid title.

Returns:
Boolean

Definition at line 751 of file SearchEngine.php.

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

Returns:
Boolean

Definition at line 762 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 708 of file SearchEngine.php.

References $result.

Referenced by SqlSearchResultSet\next().

Here is the caller graph for this function:

static SearchResult::newFromTitle ( title) [static]

Return a new SearchResult and initializes it with a title.

Parameters:
$titleTitle
Returns:
SearchResult

Definition at line 697 of file SearchEngine.php.

References $result, and $title.

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

Here is the caller graph for this function:


Member Data Documentation

SearchResult::$mImage = null

Definition at line 679 of file SearchEngine.php.

SearchResult::$mRevision = null

Definition at line 678 of file SearchEngine.php.

SearchResult::$mText

Definition at line 689 of file SearchEngine.php.

SearchResult::$mTitle

Definition at line 684 of file SearchEngine.php.


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