// only do the form render here for the empty $term case. Rendering
// the form when a search is provided is repeated below.
$out->addHTML( $formWidget->render(
// only do the form render here for the empty $term case. Rendering
// the form when a search is provided is repeated below.
$out->addHTML( $formWidget->render(
- $this->profile, $term, 0, 0, $this->offset, $this->isPowerSearch()
+ $this->profile, $term, 0, 0, $this->offset, $this->isPowerSearch(), $widgetOptions
- $search = $this->getSearchEngine();
- $search->setFeatureData( 'rewrite', $this->runSuggestion );
- $search->setLimitOffset( $this->limit, $this->offset );
- $search->setNamespaces( $this->namespaces );
- $search->setSort( $this->sort );
- $search->prefix = $this->mPrefix;
+ $engine = $this->getSearchEngine();
+ $engine->setFeatureData( 'rewrite', $this->runSuggestion );
+ $engine->setLimitOffset( $this->limit, $this->offset );
+ $engine->setNamespaces( $this->namespaces );
+ $engine->setSort( $this->sort );
+ $engine->prefix = $this->mPrefix;
- Hooks::run( 'SpecialSearchSetupEngine', [ $this, $this->profile, $search ] );
+ Hooks::run( 'SpecialSearchSetupEngine', [ $this, $this->profile, $engine ] );
if ( !Hooks::run( 'SpecialSearchResultsPrepend', [ $this, $out, $term ] ) ) {
# Hook requested termination
return;
if ( !Hooks::run( 'SpecialSearchResultsPrepend', [ $this, $out, $term ] ) ) {
# Hook requested termination
return;
- $rewritten = $search->transformSearchTerm( $term );
- if ( $rewritten !== $term ) {
- $term = $rewritten;
- wfDeprecated( 'SearchEngine::transformSearchTerm() (overridden by ' .
- get_class( $search ) . ')', '1.32' );
- }
-
- $rewritten = $search->replacePrefixes( $term );
+ $rewritten = $engine->replacePrefixes( $term );
- $titleMatches = $search->searchTitle( $rewritten );
- $textMatches = $search->searchText( $rewritten );
+ $titleMatches = $engine->searchTitle( $rewritten );
+ $textMatches = $engine->searchText( $rewritten );
$textMatchesNum = $textMatches->numRows();
$numTextMatches = $textMatches->getTotalHits();
if ( $textMatchesNum > 0 ) {
$textMatchesNum = $textMatches->numRows();
$numTextMatches = $textMatches->getTotalHits();
if ( $textMatchesNum > 0 ) {
- $this->profile, $term, $num, $totalRes, $this->offset, $this->isPowerSearch()
+ $this->profile, $term, $num, $totalRes, $this->offset, $this->isPowerSearch(), $widgetOptions
$mainResultWidget = new FullSearchResultWidget( $this, $linkRenderer );
// Default (null) on. Can be explicitly disabled.
$mainResultWidget = new FullSearchResultWidget( $this, $linkRenderer );
// Default (null) on. Can be explicitly disabled.
$sidebarResultWidget = new InterwikiSearchResultWidget( $this, $linkRenderer );
$sidebarResultsWidget = new InterwikiSearchResultSetWidget(
$this,
$sidebarResultWidget,
$linkRenderer,
MediaWikiServices::getInstance()->getInterwikiLookup(),
$sidebarResultWidget = new InterwikiSearchResultWidget( $this, $linkRenderer );
$sidebarResultsWidget = new InterwikiSearchResultSetWidget(
$this,
$sidebarResultWidget,
$linkRenderer,
MediaWikiServices::getInstance()->getInterwikiLookup(),
$offset,
$this->limit,
$this->powerSearchOptions() + [ 'search' => $term ],
$this->limit + $this->offset >= $totalRes
);
$offset,
$this->limit,
$this->powerSearchOptions() + [ 'search' => $term ],
$this->limit + $this->offset >= $totalRes
);
) {
// Reset namespace preferences: namespaces are not searched
// when they're not mentioned in the URL parameters.
) {
// Reset namespace preferences: namespaces are not searched
// when they're not mentioned in the URL parameters.
$user->setOption( 'searchNs' . $n, false );
}
// The request parameters include all the namespaces to be searched.
$user->setOption( 'searchNs' . $n, false );
}
// The request parameters include all the namespaces to be searched.