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.

The problem, unfortunately, applies even to namespaces created after a user was created/has edited his/her preferences. The problem is that method  in   does not fall back to default user options if a particular option does not exist in that user's preferences. This is quite annoying if you use namespaces to categorize article types since there is no easy way to update preferences of all users. The following implementation of  solves the problem - it uses default values for options which the user did not touch yet:

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

1.5.0 and above
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:

Prior to 1.4.5
Prior to 1.4.5, namespaces 9 and 11 were also searched.