Page MenuHomePhabricator

MediaWiki's api.php search query module srnamespace parameter defaults to 0 instead of defaulting to site-wide default namespaces to be searched
Open, LowPublic


We just had a bit of confusion in the MediaWiki-General IRC channel regarding this search: (no results).

Compare with ("Results 1 - 20 of 313").

It looks like by default, srnamespace is set to 0 in the API (cf. --> "Default: 0"), so the expected search results are "missing." You need to do this query instead:|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|100|101|102|103|104|105|106|107|460|461|490|491|828|829|1198|1199|2300|2301|2302|2303|2600

Should srnamespace's implicit default vary based on which namespaces are searched by default on the wiki? I tend to think so.

Event Timeline

MZMcBride raised the priority of this task from to Needs Triage.
MZMcBride updated the task description. (Show Details)
MZMcBride added a project: MediaWiki-API.
MZMcBride added a subscriber: MZMcBride.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptJan 19 2016, 5:24 AM

When filing T124009, I also thought maybe srnamespace could search all page namespaces by default and then specifying srnamespace would be used to narrow down the results to pages in a specific namespace.

Anomie added a subscriber: Anomie.Jan 19 2016, 3:39 PM

The difficulty with either of the suggestions here is that it would break backwards compatibility: all clients expecting the existing behavior of searching only the main namespace would unexpectedly start receiving results for other namespaces.

Anomie triaged this task as Low priority.Jan 19 2016, 3:39 PM
Anomie moved this task from Unsorted to Needs details or plan on the MediaWiki-API board.
Anomie set Security to None.