Page MenuHomePhabricator

hastemplate filter unexpectedly case-sensitive
Closed, InvalidPublic


While doing some research for an answer regarding a search question I noticed the following:

A search for creator templates in Commons seems to be case-sensitive when the template contains at least one space. This is in contradiction to mediawiki:Help:Cirrussearch (and also against the usual behaviour).

I do not know whether this is related, but there is T223046 with a contrary intention and apparently some code changes.

Edit: A search in template namespace does not have this issue. Both file: hastemplate:"Out of scope" and file: hastemplate:"out of scope" work.

Event Timeline

Reedy renamed this task from Cirrussearch: hastemplate filter unexpectedly case-sensitive to hastemplate filter unexpectedly case-sensitive.May 28 2021, 10:59 PM
Reedy added a project: CirrusSearch.
Izno closed this task as Invalid.EditedMay 30 2021, 7:48 PM
Izno subscribed.

Because you're then looking for two different pages. One called "[Ll]eonardo da Vinci" and one called "[Ll]eonardo da vinci".

Basically all the filter does is consult Whatlinkshere or equivalent, so what happens is that you end up looking for a page that doesn't exist in the latter case.

The reason the latter two work, and in fact why your first line works, is because those are the same pages, not different pages. The reason creator can be whatever case, and the letter after Creator, is because that's a namespace which doesn't care about casing, and the letter after is the start of a new page name (which on most wikis also is case insensitive).

This would all happen regardless of having a space character.

In other words, however you read the wording in the documentation to mean, that interpretation is wrong. Maybe the documentation should be updated, I don't know. I don't read "capitalization is entirely ignored" to necessarily mean anything about the capitalization after the first letter of the template, especially in context of "you can use this to find the transclusions of valid redirects".

It's my experience that hastemplate has never worked as indicated in that second example, either.