Manual:$wgNamespacesToBeSearchedDefault

Details
The variable holds an array of namespaces, numbered from -1 (Special:) and not including -2 (direct-linked media) indicating which namespaces are enabled for searching by default. The array is indexed by the numeric namespace ID, and each index holds either 0 (don't search) or 1 (search this namespace).

Note that changing this value only affects newly created and anonymous users - it does not change the settings for existing users.

Default value
Note: Each version of MediaWiki only went as far as the maximum namespace existing at the time.

1.5.0 and above
array( NS_MAIN => true )


 * OBS! This seems not to work. Anyone know a way around it?

Here are the available namespace constants if you want to add further namespaces: NS_MEDIA NS_SPECIAL NS_MAIN NS_TALK NS_USER NS_USER_TALK NS_WIKIPEDIA NS_WIKIPEDIA_TALK NS_IMAGE NS_IMAGE_TALK NS_MEDIAWIKI NS_MEDIAWIKI_TALK NS_TEMPLATE NS_TEMPLATE_TALK NS_HELP NS_HELP_TALK NS_CATEGORY NS_CATEGORY_TALK

Prior to 1.5.0
The NS_ constants weren't used (possibly because they weren't defined) so numeric values were used instead: 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 )

Prior to 1.4.5
Prior to 1.4.5, namespaces 9 and 11 were also searched. 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 )