MediaWiki REL1_34
MediaWiki\Widget\Search\DidYouMeanWidget Class Reference

Renders a suggested search for the user, or tells the user a suggested search was run instead of the one provided. More...

Collaboration diagram for MediaWiki\Widget\Search\DidYouMeanWidget:

Public Member Functions

 __construct (SpecialSearch $specialSearch)
 
 render ( $term, ISearchResultSet $resultSet)
 

Protected Member Functions

 rewrittenHtml ( $term, ISearchResultSet $resultSet)
 Generates HTML shown to user when their query has been internally rewritten, and the results of the rewritten query are being returned.
 
 suggestionHtml (ISearchResultSet $resultSet)
 Generates HTML shown to the user when we have a suggestion about a query that might give more/better results than their current query.
 

Protected Attributes

SpecialSearch $specialSearch
 

Detailed Description

Renders a suggested search for the user, or tells the user a suggested search was run instead of the one provided.

Definition at line 13 of file DidYouMeanWidget.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Widget\Search\DidYouMeanWidget::__construct ( SpecialSearch  $specialSearch)

Member Function Documentation

◆ render()

MediaWiki\Widget\Search\DidYouMeanWidget::render (   $term,
ISearchResultSet  $resultSet 
)

◆ rewrittenHtml()

MediaWiki\Widget\Search\DidYouMeanWidget::rewrittenHtml (   $term,
ISearchResultSet  $resultSet 
)
protected

Generates HTML shown to user when their query has been internally rewritten, and the results of the rewritten query are being returned.

Parameters
string$termThe users search input
ISearchResultSet$resultSetThe response to the search request
Returns
string HTML Links the user to their original $term query, and the one suggested by $resultSet

Definition at line 47 of file DidYouMeanWidget.php.

References ISearchResultSet\getQueryAfterRewrite(), and ISearchResultSet\getQueryAfterRewriteSnippet().

Referenced by MediaWiki\Widget\Search\DidYouMeanWidget\render().

◆ suggestionHtml()

MediaWiki\Widget\Search\DidYouMeanWidget::suggestionHtml ( ISearchResultSet  $resultSet)
protected

Generates HTML shown to the user when we have a suggestion about a query that might give more/better results than their current query.

Parameters
ISearchResultSet$resultSet
Returns
string HTML

Definition at line 87 of file DidYouMeanWidget.php.

References ISearchResultSet\getSuggestionQuery(), and ISearchResultSet\getSuggestionSnippet().

Referenced by MediaWiki\Widget\Search\DidYouMeanWidget\render().

Member Data Documentation

◆ $specialSearch

SpecialSearch MediaWiki\Widget\Search\DidYouMeanWidget::$specialSearch
protected

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