MediaWiki  REL1_31
SpecialSearchTestMockResultSet Class Reference
Inheritance diagram for SpecialSearchTestMockResultSet:
Collaboration diagram for SpecialSearchTestMockResultSet:

Public Member Functions

 __construct ( $suggestion=null, $rewrittenQuery=null, array $results=[], $containedSyntax=false)
 
 getQueryAfterRewrite ()
 
 getQueryAfterRewriteSnippet ()
 
 getSuggestionQuery ()
 
 getSuggestionSnippet ()
 
 getTotalHits ()
 Some search modes return a total hit count for the query in the entire article database. More...
 
 hasRewrittenQuery ()
 Some search modes will run an alternative query that it thinks gives a better result than the provided search. More...
 
 hasSuggestion ()
 Some search modes return a suggested alternate term if there are no exact hits. More...
 
 numRows ()
 
- Public Member Functions inherited from SearchResultSet
 __construct ( $containedSyntax=false)
 
 augmentResult (SearchResult $result)
 Returns extra data for specific result and store it in SearchResult object. More...
 
 extractResults ()
 Extract all the results in the result set as array. More...
 
 extractTitles ()
 Extract all the titles in the result set. More...
 
 free ()
 Frees the result set, if applicable. More...
 
 getInterwikiResults ( $type=self::SECONDARY_RESULTS)
 Return a result set of hits on other (multiple) wikis associated with this one. More...
 
 getOffset ()
 
 hasInterwikiResults ( $type=self::SECONDARY_RESULTS)
 Check if there are results on other wikis. More...
 
 next ()
 Fetches next search result, or false. More...
 
 rewind ()
 Rewind result set back to beginning. More...
 
 searchContainedSyntax ()
 Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a page named by the search string because the name would contain the search syntax. More...
 
 setAugmentedData ( $name, $data)
 Sets augmented data for result set. More...
 
 termMatches ()
 Fetch an array of regular expression fragments for matching the search terms as parsed by this engine in a text extract. More...
 

Protected Attributes

 $results
 
 $suggestion
 
- Protected Attributes inherited from SearchResultSet
 $containedSyntax = false
 Types of interwiki results. More...
 
array[] $extraData = []
 Set of result's extra data, indexed per result id and then per data item name. More...
 

Detailed Description

Definition at line 249 of file SpecialSearchTest.php.

Constructor & Destructor Documentation

◆ __construct()

SpecialSearchTestMockResultSet::__construct (   $suggestion = null,
  $rewrittenQuery = null,
array  $results = [],
  $containedSyntax = false 
)

Definition at line 253 of file SpecialSearchTest.php.

References SearchResultSet\$containedSyntax, $results, and $suggestion.

Member Function Documentation

◆ getQueryAfterRewrite()

SpecialSearchTestMockResultSet::getQueryAfterRewrite ( )
Returns
string|null The search the query was internally rewritten to, or null when the result of the original query was returned.

Reimplemented from SearchResultSet.

Definition at line 289 of file SpecialSearchTest.php.

◆ getQueryAfterRewriteSnippet()

SpecialSearchTestMockResultSet::getQueryAfterRewriteSnippet ( )
Returns
string|null Same as self::getQueryAfterRewrite(), but in HTML and with changes highlighted. Null when the query was not rewritten.

Reimplemented from SearchResultSet.

Definition at line 293 of file SpecialSearchTest.php.

◆ getSuggestionQuery()

SpecialSearchTestMockResultSet::getSuggestionQuery ( )
Returns
string|null Suggested query, null if none

Reimplemented from SearchResultSet.

Definition at line 277 of file SpecialSearchTest.php.

References $suggestion.

◆ getSuggestionSnippet()

SpecialSearchTestMockResultSet::getSuggestionSnippet ( )
Returns
string HTML highlighted suggested query, '' if none

Reimplemented from SearchResultSet.

Definition at line 281 of file SpecialSearchTest.php.

References $suggestion.

◆ getTotalHits()

SpecialSearchTestMockResultSet::getTotalHits ( )

Some search modes return a total hit count for the query in the entire article database.

This may include pages in namespaces that would not be matched on the given settings.

Return null if no total hits number is supported.

Returns
int

Reimplemented from SearchResultSet.

Definition at line 269 of file SpecialSearchTest.php.

References numRows().

◆ hasRewrittenQuery()

SpecialSearchTestMockResultSet::hasRewrittenQuery ( )

Some search modes will run an alternative query that it thinks gives a better result than the provided search.

Returns true if this has occured.

Returns
bool

Reimplemented from SearchResultSet.

Definition at line 285 of file SpecialSearchTest.php.

◆ hasSuggestion()

SpecialSearchTestMockResultSet::hasSuggestion ( )

Some search modes return a suggested alternate term if there are no exact hits.

Returns true if there is one on this set.

Returns
bool

Reimplemented from SearchResultSet.

Definition at line 273 of file SpecialSearchTest.php.

◆ numRows()

SpecialSearchTestMockResultSet::numRows ( )

Reimplemented from SearchResultSet.

Definition at line 265 of file SpecialSearchTest.php.

Referenced by getTotalHits().

Member Data Documentation

◆ $results

SpecialSearchTestMockResultSet::$results
protected

Definition at line 250 of file SpecialSearchTest.php.

Referenced by __construct().

◆ $suggestion

SpecialSearchTestMockResultSet::$suggestion
protected

Definition at line 251 of file SpecialSearchTest.php.

Referenced by __construct(), getSuggestionQuery(), and getSuggestionSnippet().


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