Page MenuHomePhabricator

Make SimpleSearch parameters to ApiOpenSearch configurable
Closed, ResolvedPublic

Description

The SimpleSearch search box in the Vector skin does not obey $wgMWSuggestTemplate. Instead, the opensearch string values are hard-coded in Vector/modules/ext.vector.simpleSearch.js.


Version: 1.21.x
Severity: enhancement
Whiteboard: gci2013 https://www.mediawiki.org/wiki/Google_Code-In#Candidate_tasks

Details

Reference
bz30089

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:53 PM
bzimport set Reference to bz30089.
bzimport added a subscriber: Unknown Object (MLST).

$wgMWSuggestTemplate (and the old MWSuggest itself) should probably be removed entirely in favor of the more modern interface that consistently uses the OpenSearch suggestions API.

Thanks Brion. Would that allow wiki admins to modify the opensearch parameters (e.g., set limit=20 instead of 10)? That's the problem we're having. This was easy to do previously with $wgMWSuggestTemplate.

It ignores wgMWSuggestTemplate because it's not MWSuggest but SimpleSearch. They are both separate scripts.

We could probably implement a configuration open for it though. Right now Vector's SimpleSearch doesn't set any hardcoded limit, it calls ApiOpenSearch without any limit, the api itself has a default limit of 10.

Is this still valid? The search suggestions functionality has been reworked entirely some time ago...

Is it now possible to set the length of the search box suggestion list? (That is, the number of search suggestions returned.)

I've just looked and it doesn't seem so. Search suggestions script in /resources/mediawiki/mediawiki.searchSuggest.js now uses the default limit, which is set to 10 in /includes/api/ApiOpenSearch.php.

This could probably be made configurable; Dan, do you have gerrit/Labs account? You could submit a patch yourself :) [https://www.mediawiki.org/wiki/Developer_access]

[Marking bug as 'easy'.]

Thanks for the offer. I do not have git access and probably should keep it that way for now. :-) (Too busy.)

https://gerrit.wikimedia.org/r/#/c/96162/

For some reason the bug report hasn't been updated automatically by Gerrit.

(In reply to comment #8)

For some reason the bug report hasn't been updated automatically by Gerrit.

The commit message did not end with a line saying "Bug: 30089".
See http://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines :)

Change 96162 had a related patch set uploaded by MegaAlex:
API: Add default setting for OpenSearch limit parameter

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

Change 96162 merged by jenkins-bot:
API: Add default setting for OpenSearch limit parameter

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