* (bug 42026) Added ucshow={new,!new,top,!top} to list=usercontribs.
Also added newonly to action=feedcontributions.
* (bug 42026) Deprecated uctoponly in favor of ucshow=top.
+* list=search no longer has a "srredirects" parameter. Redirects are now
+ included in all searches.
=== Languages updated in 1.23 ===
us to extend parser tests to accommodate additional input/output
pairs, such as "!!html/parsoid" (for the output of the Parsoid
parser, where it differs from the PHP parser).
+* Special:Search no longer has an "include redirects" option on the advanced
+ tab. Redirects are now included in all searches.
==== Removed classes ====
* FakeMemCachedClient (deprecated in 1.18)
SearchEngine::create( $params['backend'] ) : SearchEngine::create();
$search->setLimitOffset( $limit + 1, $params['offset'] );
$search->setNamespaces( $params['namespace'] );
- $search->showRedirects = $params['redirects'];
$query = $search->transformSearchTerm( $query );
$query = $search->replacePrefixes( $query );
),
ApiBase::PARAM_ISMULTI => true,
),
- 'redirects' => false,
'offset' => 0,
'limit' => array(
ApiBase::PARAM_DFLT => 10,
' sectiontitle - Adds the title of the matching section',
' hasrelated - Indicates whether a related search is available',
),
- 'redirects' => 'Include redirect pages in the search',
'offset' => 'Use this value to continue paging (return by query)',
'limit' => 'How many total pages to return',
'interwiki' => 'Include interwiki results in the search, if available'
var $prefix = '';
var $searchTerms = array();
var $namespaces = array( NS_MAIN );
- var $showRedirects = false;
protected $showSuggestion = true;
/// Feature values
*/
public function supports( $feature ) {
switch ( $feature ) {
- case 'list-redirects':
case 'search-update':
return true;
case 'title-suffix-filter':
return new MssqlSearchResultSet( $resultSet, $this->searchTerms );
}
- /**
- * Return a partial WHERE clause to exclude redirects, if so set
- *
- * @return String
- * @private
- */
- function queryRedirect() {
- if ( $this->showRedirects ) {
- return '';
- } else {
- return 'AND page_is_redirect=0';
- }
- }
-
/**
* Return a partial WHERE clause to limit the search to the given namespaces
*
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
- $this->queryRedirect() . ' ' .
$this->queryNamespaces() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
}
*/
protected function queryFeatures( &$query ) {
foreach ( $this->features as $feature => $value ) {
- if ( $feature === 'list-redirects' && !$value ) {
- $query['conds']['page_is_redirect'] = 0;
- } elseif ( $feature === 'title-suffix-filter' && $value ) {
+ if ( $feature === 'title-suffix-filter' && $value ) {
$query['conds'][] = 'page_title' . $this->db->buildLike( $this->db->anyString(), $value );
}
}
return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
}
- /**
- * Return a partial WHERE clause to exclude redirects, if so set
- * @return String
- */
- function queryRedirect() {
- if ( $this->showRedirects ) {
- return '';
- } else {
- return 'AND page_is_redirect=0';
- }
- }
-
/**
* Return a partial WHERE clause to limit the search to the given namespaces
* @return String
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
- $this->queryRedirect() . ' ' .
$this->queryNamespaces() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
}
"AND r.rev_text_id = c.old_id AND $fulltext @@ to_tsquery($searchstring)";
}
- ## Redirects
- if ( !$this->showRedirects ) {
- $query .= ' AND page_is_redirect = 0';
- }
-
## Namespaces - defaults to 0
if ( !is_null( $this->namespaces ) ) { // null -> search all
if ( count( $this->namespaces ) < 1 ) {
return new SqliteSearchResultSet( $resultSet, $this->searchTerms, $total );
}
- /**
- * Return a partial WHERE clause to exclude redirects, if so set
- * @return String
- */
- function queryRedirect() {
- if ( $this->showRedirects ) {
- return '';
- } else {
- return 'AND page_is_redirect=0';
- }
- }
-
/**
* Return a partial WHERE clause to limit the search to the given namespaces
* @return String
function getQuery( $filteredTerm, $fulltext ) {
return $this->limitResult(
$this->queryMain( $filteredTerm, $fulltext ) . ' ' .
- $this->queryRedirect() . ' ' .
$this->queryNamespaces()
);
}
$searchindex = $this->db->tableName( 'searchindex' );
return "SELECT COUNT(*) AS c " .
"FROM $page,$searchindex " .
- "WHERE page_id=$searchindex.rowid AND $match" .
- $this->queryRedirect() . ' ' .
+ "WHERE page_id=$searchindex.rowid AND $match " .
$this->queryNamespaces();
}
*/
protected $namespaces;
- /**
- * @var bool
- */
- protected $searchRedirects;
-
/**
* @var string
*/
}
}
- // Redirects defaults to true, but we don't know whether it was ticked of or just missing
- $default = $request->getBool( 'profile' ) ? 0 : 1;
- $this->searchRedirects = $request->getBool( 'redirs', $default ) ? 1 : 0;
$this->didYouMeanHtml = ''; # html of did you mean... link
$this->fulltext = $request->getVal( 'fulltext' );
$this->profile = $profile;
$search = $this->getSearchEngine();
$search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
- $search->showRedirects = $this->searchRedirects; // BC
- $search->setFeatureData( 'list-redirects', $this->searchRedirects );
$search->prefix = $this->mPrefix;
$term = $search->transformSearchTerm( $term );
*/
protected function powerSearchOptions() {
$opt = array();
- $opt['redirs'] = $this->searchRedirects ? 1 : 0;
if ( $this->profile !== 'advanced' ) {
$opt['profile'] = $this->profile;
} else {
protected function getProfileForm( $profile, $term ) {
// Hidden stuff
$opts = array();
- $opts['redirs'] = $this->searchRedirects;
$opts['profile'] = $this->profile;
if ( $profile === 'advanced' ) {
$showSections = array( 'namespaceTables' => $namespaceTables );
- // Show redirects check only if backend supports it
- if ( $this->getSearchEngine()->supports( 'list-redirects' ) ) {
- $showSections['redirects'] =
- Xml::checkLabel( $this->msg( 'powersearch-redir' )->text(), 'redirs', 'redirs', $this->searchRedirects );
- }
-
wfRunHooks( 'SpecialSearchPowerBox', array( &$showSections, $term, $opts ) );
$hidden = '';
- unset( $opts['redirs'] );
foreach ( $opts as $key => $value ) {
$hidden .= Html::hidden( $key, $value );
}
foreach ( $namespaces as $n ) {
$opt['ns' . $n] = 1;
}
- $opt['redirs'] = $this->searchRedirects;
$stParams = array_merge(
array(