SearchResult Class Reference
[Search]

Inherited by PostgresSearchResult.

List of all members.

Public Member Functions

 __construct ($row)
 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.
 getTitle ()
 getScore ()
 getTextSnippet ($terms)
 getTitleSnippet ($terms)
 getRedirectSnippet ($terms)
 getRedirectTitle ()
 getSectionSnippet ()
 getSectionTitle ()
 getTimestamp ()
 getWordCount ()
 getByteSize ()
 hasRelated ()
 getInterwikiPrefix ()

Public Attributes

 $mRevision = null
 $mImage = null

Protected Member Functions

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


Constructor & Destructor Documentation

SearchResult::__construct ( row  ) 

Reimplemented in PostgresSearchResult.

Definition at line 597 of file SearchEngine.php.

References Title::makeTitle(), Revision::newFromTitle(), and wfFindFile().


Member Function Documentation

SearchResult::getByteSize (  ) 

Returns:
Integer: size in bytes

Definition at line 727 of file SearchEngine.php.

References initText().

SearchResult::getInterwikiPrefix (  ) 

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

Definition at line 742 of file SearchEngine.php.

SearchResult::getRedirectSnippet ( terms  ) 

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

Definition at line 680 of file SearchEngine.php.

SearchResult::getRedirectTitle (  ) 

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

Definition at line 687 of file SearchEngine.php.

SearchResult::getScore (  ) 

Returns:
Double or null if not supported

Reimplemented in PostgresSearchResult.

Definition at line 636 of file SearchEngine.php.

SearchResult::getSectionSnippet (  ) 

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

Definition at line 694 of file SearchEngine.php.

SearchResult::getSectionTitle (  ) 

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

Definition at line 701 of file SearchEngine.php.

SearchResult::getTextSnippet ( terms  ) 

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

Definition at line 657 of file SearchEngine.php.

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

SearchResult::getTimestamp (  ) 

Returns:
String: timestamp

Definition at line 708 of file SearchEngine.php.

SearchResult::getTitle (  ) 

Returns:
Title

Definition at line 629 of file SearchEngine.php.

SearchResult::getTitleSnippet ( terms  ) 

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

Definition at line 672 of file SearchEngine.php.

SearchResult::getWordCount (  ) 

Returns:
Integer: number of words

Definition at line 719 of file SearchEngine.php.

References initText().

SearchResult::hasRelated (  ) 

Returns:
Boolean if hit has related articles

Definition at line 735 of file SearchEngine.php.

SearchResult::initText (  )  [protected]

Lazy initialization of article text from DB.

Definition at line 643 of file SearchEngine.php.

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

SearchResult::isBrokenTitle (  ) 

Check if this is result points to an invalid title.

Returns:
Boolean

Definition at line 611 of file SearchEngine.php.

SearchResult::isMissingRevision (  ) 

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

Returns:
Boolean

Definition at line 622 of file SearchEngine.php.


Member Data Documentation

SearchResult::$mImage = null

Definition at line 595 of file SearchEngine.php.

SearchResult::$mRevision = null

Definition at line 594 of file SearchEngine.php.


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

Generated on Sat Apr 30 22:57:48 2011 for MediaWiki by  doxygen 1.5.9