SearchResult Class Reference
[Search]

This class is horribly factored. More...

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

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


Constructor & Destructor Documentation

SearchResult::__construct ( row  ) 

Reimplemented in PostgresSearchResult.

Definition at line 551 of file SearchEngine.php.

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


Member Function Documentation

SearchResult::getByteSize (  ) 

Returns:
int size in bytes

Definition at line 684 of file SearchEngine.php.

References initText().

SearchResult::getInterwikiPrefix (  ) 

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

Definition at line 699 of file SearchEngine.php.

SearchResult::getRedirectSnippet ( terms  ) 

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

Definition at line 637 of file SearchEngine.php.

SearchResult::getRedirectTitle (  ) 

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

Definition at line 644 of file SearchEngine.php.

SearchResult::getScore (  ) 

Returns:
double or null if not supported

Reimplemented in PostgresSearchResult.

Definition at line 593 of file SearchEngine.php.

SearchResult::getSectionSnippet (  ) 

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

Definition at line 651 of file SearchEngine.php.

SearchResult::getSectionTitle (  ) 

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

Definition at line 658 of file SearchEngine.php.

SearchResult::getTextSnippet ( terms  ) 

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

Definition at line 614 of file SearchEngine.php.

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

SearchResult::getTimestamp (  ) 

Returns:
string timestamp

Definition at line 665 of file SearchEngine.php.

SearchResult::getTitle (  ) 

Returns:
Title
Access:
public

Definition at line 586 of file SearchEngine.php.

SearchResult::getTitleSnippet ( terms  ) 

Parameters:
array $terms terms to highlight
Returns:
string highlighted title, '' if not supported

Definition at line 629 of file SearchEngine.php.

SearchResult::getWordCount (  ) 

Returns:
int number of words

Definition at line 676 of file SearchEngine.php.

References initText().

SearchResult::hasRelated (  ) 

Returns:
boolean if hit has related articles

Definition at line 692 of file SearchEngine.php.

SearchResult::initText (  )  [protected]

Lazy initialization of article text from DB.

Definition at line 600 of file SearchEngine.php.

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

SearchResult::isBrokenTitle (  ) 

Check if this is result points to an invalid title.

Returns:
boolean
Access:
public

Definition at line 566 of file SearchEngine.php.

SearchResult::isMissingRevision (  ) 

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

Returns:
boolean
Access:
public

Definition at line 578 of file SearchEngine.php.


Member Data Documentation

SearchResult::$mImage = null

Definition at line 549 of file SearchEngine.php.

SearchResult::$mRevision = null

Definition at line 548 of file SearchEngine.php.


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

Generated on Sat Sep 5 02:08:46 2009 for MediaWiki by  doxygen 1.5.9