Page MenuHomePhabricator

UploadWizard: Make category suggestions case-insensitive
Closed, ResolvedPublic

Description


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=40076

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:08 AM
bzimport set Reference to bz38785.
bzimport added a subscriber: Unknown Object (MLST).

I wrote a comment, but it failed to upload from some reason, re-submitting:

When one add a category through upload wizard category adder, it give some suggestion (using hot-cat style). Though, when try to add something like:
Professors from israel, the suggestion stops at the i since the category's name is Professors from Israel. Would be moew user-friendly to suggest the right category name and if choosen, uppercase or lowercase as needed.

Hi there!

We accomplish this using the mw.api.getCategoriesByPrefix [0] function. Until that function has this capability, this is not a UW bug, it's upstream. Sorry!

[0] https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=resources/mediawiki.api/mediawiki.api.category.js;h=c8c18e69fa69302e731ccea9ec1fa5eb48d99ce8;hb=master#l43

Recategorizing.

The mediawiki.api module is just a convenience wrapper in javascript around jQuery.ajax and the server-side api.php. Features such as case-insensitive search require much deeper integration:

  • (massive) Database indexes for searching
  • then (easy) support in the api.php module for allpages/prefix

mediawiki.api.category would transparently start working (or if needed, pass a simple parameter to trigger it)

Rephrasing bug to represent the original use case.

Implementation could vary. Implementing case-insensitive prefix search in allpages would require a huge database index probably.

Another solution would be to make mw.Api.getCategoriesByPrefix() make use of ApiOpenSearch (action=opensearch) which (if TitleKey is installed, which it is on Wikimedia) supports case-insensitive search.

I am not sure if this is low-enhancement because reports of unpleased users are popping up:
https://commons.wikimedia.org/w/index.php?oldid=113075033#Category_selection
Importance: Normal-normal (Of course you are free to revert me)

Also: Hotcat supports this feature. I could not find the line in the source code but it may be possible to steal it.

matmarex renamed this task from mediawiki.api: Implement support for case-insensitive prefix search in getCategoriesByPrefix() to UploadWizard: Make category suggestions case-insensitive .Dec 31 2014, 9:40 PM
matmarex updated the task description. (Show Details)
matmarex edited projects, added UploadWizard, JavaScript; removed MediaWiki-JavaScript.
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).
matmarex added a subscriber: matmarex.

getCategoriesByPrefix() has no business caring about case sensitivity, the underlying API is case-sensitive by design. UploadWizard should use something like search suggestions (action=opensearch), which is case-insensitive.

Change 208932 had a related patch set uploaded (by Prtksxna):
mwCoolCats: Use action=opensearch instead of getCategoriesByPrefix()

https://gerrit.wikimedia.org/r/208932

Change 208932 merged by jenkins-bot:
mwCoolCats: Use action=opensearch instead of getCategoriesByPrefix()

https://gerrit.wikimedia.org/r/208932

Thanks so much. took three years, but here it is!

That sounds like our average, pretty much. :)