Last modified: 2011-04-14 15:12:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T17018, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15018 - Limiting which namespaces can be searched
Limiting which namespaces can be searched
Status: NEW
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
1.16.x
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.mediawiki.org/w/index.php?...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-02 23:13 UTC by Emufarmers
Modified: 2011-04-14 15:12 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Emufarmers 2008-08-02 23:13:50 UTC
As suggested on the talk page in the URL field.  Could be set with a variable, $wgSearchOnlyContentNamespaces, which would default to false, of course.

On the other hand, the default doesn't count Project: as a content namespace, and people might want to search it without changing that, so maybe it would make more sense not to couple this with $wgContentNamespaces, and instead make it as flexible as possible with a new variable, $wgSearchableNamespaces, which would default to including all namespaces.  This might not work too well with extra namespaces, though, so maybe it would be better to have $wgUnsearchableNamespaces.
Comment 1 Mark Clements (HappyDog) 2008-08-04 06:10:15 UTC
Basically, as I understand it, we have $wgContentNamespaces which define the namespaces that count as content (for stats) and $wgNamespacesToBeSearchedDefault which defines which namespaces are selected for searching in a new user's preferences.  This request is asking for a way of suppressing namespaces from this list, and from the list of namespaces at the bottom of the search results page (the 'advanced search' feature).

There are several options.  The two suggested above are:

* $wgSearchableNamespaces - to hold an array of namespaces that appear in these lists (though you have to remember to update this if new namespaces are added)
* $wgNonSearchableNamespaces - to hold an array of namespaces to omit from the list.

An alternative and simpler (UI-wise) solution might be to have an replacement interface that can be enabled via LocalSettings.php:

* $wgSearchUseSimplifiedNamespaces - if false, behaviour is same as now.  If true, the list of namespaces in the advanced search and the user preferences is replaced with 3 radio buttons to toggle between 'search main content namespaces' (only those defined in $wgContentNamespaces) ''search all content namespaces' (everything except Image:, MediaWiki:, Template: and Category:) and 'search entire wiki' which includes the lot.  There should also be an 'include talk pages' option which if selected searches the talk pages of the selected namespaces.
Comment 2 Daniel Remeseiro 2009-02-03 18:45:20 UTC
i think .... also there are many people  who wants to enable/disable the advanced search.
I suggest a new global boolean var:

$wgPowerSearchSelection - if false nothing happens , the advanced search shows as mediawiki now: all checkboxes of all namespaces.

-if true then triggers to read the $wgNamespacesToBeSearchedDefault array values and show just this checkboxes options.
Comment 3 Dan Jacobson 2009-06-07 00:35:28 UTC
Offline, I discovered the same bug, and wrote the following:

==Search namespaces hardwired==

Below I'm not talking about which namespaces the user can have checked
by default, but instead what namespaces he will see visible at all on 
Special:Search and Special:Preferences in the first place.

SearchEngine.php's searchableNamespaces() is hardwired and
doesn't let anybody e.g., take NS_FILE, NS_FILE_TALK off the list, for
sites with $wgEnableUploads = false; meaning they show up in
Special:Search, though useless.
What's worse is in Preferences.php, the namespaces are again hardwired:
  foreach( $wgContLang->getNamespaces() as $ns => $name ) {
    if ($ns < 0) continue;
Sure, searchableNamespaces() is seen in several places in
Preferences.php, apparently left behind detached.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links