I have a wiki for hiking in Washington State called TrailWIKI.org I use a couple different namespaces for internal use and do not want users to be confused on the search page with all the additional namespaces. I could not find a way to remove only some of the namespaces from the advanced search box so I decided to remove the entire advanced search box.
To prevent this what I did was remove the Advanced Search box from the search page. I also added aditional namespaces to my default namespaces to search so uses can search namespaceslike talk, user, and categories, help…
First you will need to add additional namespaces to the search default.
LocalSettings.php add the following in the end:
# SEARCH: default namespaces to search in $myAdditionalNamespacesSearchDefault = array( NS_MAIN, NS_TALK, NS_USER, NS_USER_TALK, NS_HELP, NS_HELP_TALK, NS_CATEGORY, NS_CATEGORY_TALK );
edit the namespaces above with the namspaces you want to search in.
Now we need to remove the advance search box from the search page.
Then open includes/specials/SpecialSearch.php
and change the following code arround line 268
$wgOut->addHTML( $this->powerSearchBox( $term ) ); wfProfileOut( $fname ); }
// the following line was commented to hide the advanced search box // $wgOut->addHTML( $this->powerSearchBox( $term ) ); wfProfileOut( $fname ); }
Then you may need to change the message that appears when no results are found, to do this go to Special:AllMessages and change the “nonefound” message as required.
The original message is
”’Note”’: Only some namespaces are searched by default. Try prefixing your query with ”all:” to search all content (including talk pages, templates, etc), or use the desired namespace as prefix.
You may change it to something like
* Make sure all words are spelled correctly.
* Try different keywords.
* Try more general keywords.
* Try fewer keywords.
See my example at http://www.trailwiki.us/wiki/Special:Search?search=asdf&go=Go
By the way, you can enhance the searching by allowing search suggestion:
add the following like to LocalSettings.php
# turn on search suggestion $wgEnableMWSuggest = true;
My new search screen shows as following
Hope this helps you out! :-)