Manual:$wgNamespacesToBeSearchedDefault/ru

From Linux Web Expert

<translate> Search</translate>: $wgNamespacesToBeSearchedDefault
Which namespaces should be searched?
<translate> Introduced in version:</translate>pre 1.1.0
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>see below
<translate> Default value:</translate>see below

The variable holds an array of namespaces, indicating which namespaces are enabled for searching by default. The array is indexed by the namespace constant. Namespaces not added will not be searched by default.

Default value

Версия MediaWiki:
<translate> ≥</translate> 1.5
$wgNamespacesToBeSearchedDefault = [
	NS_MAIN => true,
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.4</tvar> is unsupported version</translate>">
1.4
Версия MediaWiki:
$wgNamespacesToBeSearchedDefault = array( -1 => 0, 0 => 1, 1 => 0,
  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0 );
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.3</tvar> is unsupported version</translate>">
1.3
Версия MediaWiki:
$wgNamespacesToBeSearchedDefault = array( -1 => 0, 0 => 1, 1 => 0,
  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 1, 10 => 0, 11 => 1 );
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.2</tvar> is unsupported version</translate>">
1.1 – 1.2
<translate> MediaWiki versions:</translate>
$wgNamespacesToBeSearchedDefault = array( -1 => 0, 0 => 1, 1 => 0,
  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0 );

Adding namespaces

To add other namespaces you just add this to your "LocalSettings.php" file, e. g. for the project namespace:

$wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;

Effect of adding/removing namespace

Версия MediaWiki:
<translate> ≥</translate> 1.16

In MediaWiki 1.16 and later, adding or removing namespace will apply to all users.

<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.15</tvar> is unsupported version</translate>">
<translate> ≤</translate> 1.15
Версия MediaWiki:

In MediaWiki 1.15 and prior, adding or removing namespace will only affects anonymous users and accounts created after the change.