Page MenuHomePhabricator

"Go" search should check if page exists in namespaces other than main
Open, LowPublic

Description

Author: chris

Description:
Steps to reproduce (on Wikipedia, but I think it is a problem with MediaWiki):

  1. Go to your user preferences page and click on the search tab.
  2. Uncheck the (Main) namespace and check the Wikipedia namespace.
  3. Click save.
  4. In the search field on the left panel, type "columns" without quotation marks.

Result:
You are taken to the (Main namespace) article, Column

Expected result:
Articles in the Wikipedia namespace that explain how to format wiki text into columns.

Speculation:
It seems that the "I'm feeling lucky"-esque functionality is interfering with the namespace exclusion.


Version: 1.12.x
Severity: normal

Details

Reference
bz11380

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:55 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz11380.
bzimport added a subscriber: Unknown Object (MLST).

The 'go' hit always goes to the requested page title and is unrelated to your search preferences.

I'm not sure if it would be desireable to limit it to search namespaces... but that might end up doing something useful. Worth considering at least.

A likely implementation might loop through all requested namespaces to do the checks in SearchEngine::getNearMatch, using the default namespace parameter on Title::newFromText() to apply a namespace if not included already in the search term.

alxndr wrote:

patch to SpecialSearch::goResult()

After SearchEngine::getNearMatch($term), only redirects to the resulting Title if it's in a namespace the user has chosen to search.

Attached:

Hmm, go needs to *always* go to the specific page you request when you request it, as that's its function.

So I wouldn't accept this patch.

alxndr wrote:

"go needs to *always* go to the specific page you request when you request it"

So, except for the main namespace?

For any namespace.

I outlined above a way to have the Go matches match patches in the specified search namespaces where no namespace is given in the search term (eg 'column') without breaking when a namespace is included (eg 'talk:column' or ':column'). Title::newFromText() has this logic already available when passing it a default namespace parameter.

"Go" tried the specific page, you need the namespace in order to get non-main pages.

  • Bug 19862 has been marked as a duplicate of this bug. ***
  • Bug 25432 has been marked as a duplicate of this bug. ***

Changed title/summary so it is no longer monobook centric.

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

Thanks for your patch, Alexander. Marking "reviewed" per comment 4 and comments after.

Nemo_bis removed epriestley as the assignee of this task.
Nemo_bis added a subscriber: epriestley.