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

Public Member Functions

 __construct ( $suggestion=null, $rewrittenQuery=null, array $results=[], $containedSyntax=false)
 
 expandResults ()
 
 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...
 
- Public Member Functions inherited from SearchResultSet
 __construct ( $containedSyntax=false, $hasMoreResults=false)
 
 augmentResult (SearchResult $result)
 Returns extra data for specific result and store it in SearchResult object. More...
 
 count ()
 
 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...
 
 getIterator ()
 
 getOffset ()
 
 hasInterwikiResults ( $type=self::SECONDARY_RESULTS)
 Check if there are results on other wikis. More...
 
 hasMoreResults ()
 
 next ()
 Fetches next search result, or false. More...
 
 numRows ()
 
 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...
 
 shrink ( $limit)
 
 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...
 
SearchResult[] $results
 Cache of results - serialization of the result iterator as an array. More...
 

Detailed Description

Definition at line 254 of file SpecialSearchTest.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 258 of file SpecialSearchTest.php.

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

Member Function Documentation

◆ expandResults()

SpecialSearchTestMockResultSet::expandResults ( )

Definition at line 270 of file SpecialSearchTest.php.

References $results.

◆ 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 294 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 298 of file SpecialSearchTest.php.

◆ getSuggestionQuery()

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

Reimplemented from SearchResultSet.

Definition at line 282 of file SpecialSearchTest.php.

References $suggestion.

◆ getSuggestionSnippet()

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

Reimplemented from SearchResultSet.

Definition at line 286 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 274 of file SpecialSearchTest.php.

References SearchResultSet\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 occurred.

Returns
bool

Reimplemented from SearchResultSet.

Definition at line 290 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 278 of file SpecialSearchTest.php.

Member Data Documentation

◆ $results

SpecialSearchTestMockResultSet::$results
protected

Definition at line 255 of file SpecialSearchTest.php.

Referenced by __construct(), and expandResults().

◆ $suggestion

SpecialSearchTestMockResultSet::$suggestion
protected

Definition at line 256 of file SpecialSearchTest.php.

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


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