r86734 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86733‎ | r86734 | r86735 >
Date:20:12, 22 April 2011
Author:nikerabbit
Status:resolved (Comments)
Tags:
Comment:
Cleanup next/prev links on special:search. Removed unused mPrefix.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -81,7 +81,6 @@
8282 */
8383 public function load( &$request, &$user ) {
8484 list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, 'searchlimit' );
85 - $this->mPrefix = $request->getVal('prefix', '');
8685
8786
8887 # Extract manually requested namespaces
@@ -177,7 +176,6 @@
178177 $search->setNamespaces( $this->namespaces );
179178 $search->showRedirects = $this->searchRedirects; // BC
180179 $search->setFeatureData( 'list-redirects', $this->searchRedirects );
181 - $search->prefix = $this->mPrefix;
182180 $term = $search->transformSearchTerm($term);
183181
184182 wfRunHooks( 'SpecialSearchSetupEngine', array( $this, $this->profile, $search ) );
@@ -430,12 +428,13 @@
431429 */
432430 protected function powerSearchOptions() {
433431 $opt = array();
434 - foreach( $this->namespaces as $n ) {
435 - $opt['ns' . $n] = 1;
436 - }
437432 $opt['redirs'] = $this->searchRedirects ? 1 : 0;
438 - if( $this->profile ) {
 433+ if( $this->profile !== 'advanced' ) {
439434 $opt['profile'] = $this->profile;
 435+ } else {
 436+ foreach( $this->namespaces as $n ) {
 437+ $opt['ns' . $n] = 1;
 438+ }
440439 }
441440 return $opt;
442441 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r90452Partial revert of r86734: restore mPrefix - I still don't know what it doesnikerabbit09:35, 20 June 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   00:09, 15 June 2011

There are explicit references to this prefix parameter in comments for base class SearchEngine::transformSearchTerm.

MWSearch's LuceneSearch::transformSearchTerm() definitely uses it, turning it into a special 'prefix:' term. This seems to still be the extension we use in production on Wikipedia, so... probably don't remove it?

#Comment by Nikerabbit (talk | contribs)   05:38, 15 June 2011

Okay I missed that.

Status & tagging log