I believe you have to do this in two steps:
1. Set up default preferences for all NEW users (who have never logged in yet)
This is done in LocalSettings.php by setting $wgNamespacesToBeSearchedDefault. For example:
# Choose the namespaces $myAdditionalNamespacesSearchDefault = array( NS_MAIN, NS_TALK, NS_USER, NS_USER_TALK, NS_PROJECT, NS_PROJECT_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 ); foreach ($myAdditionalNamespacesSearchDefault as $value) { $wgNamespacesToBeSearchedDefault[$value] = true; }
2. Setting default preferences for all EXISTING users
This is done in the database in the user table. For example:
UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs1=0', 'searchNs1=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs2=0', 'searchNs2=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs3=0', 'searchNs3=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs4=0', 'searchNs4=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs5=0', 'searchNs5=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs6=0', 'searchNs6=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs7=0', 'searchNs7=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs8=0', 'searchNs8=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs9=0', 'searchNs9=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs10=0', 'searchNs10=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs11=0', 'searchNs11=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs12=0', 'searchNs12=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs13=0', 'searchNs13=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs14=0', 'searchNs14=1'); UPDATE YOUR_PREFIX_user SET user_options = REPLACE(user_options, 'searchNs15=0', 'searchNs15=1');
where "YOUR_PREFIX_" is whatever database table prefix is used for your wiki.
DanB