Page MenuHomePhabricator

Suggestions in search for Wikipedia Mobile
Closed, ResolvedPublic


Author: malrase

Is it possible to have a "suggested searches" thing for the search box? I.e. typing "Fra-" gives "France" as one of the first ones, or something.

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:39 PM
bzimport set Reference to bz19956.
bzimport added a subscriber: Unknown Object (MLST).

I'm guessing you'll have to wait quite a while more on this one.

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

admin wrote:

The source code for a working example

This is a problem made easy by Wikipedia's existing API. I have a working example (modified after at - try it on your mobile phone! See also my personal site's example (a stripped down version):

The changes attached are minimal to the already existing page at I'm using that as comparison instead of for simplicity's sake only--the changes would be similar there. If you compare the HTML source from with the source attached that you will see I have only added 4 lines in the <head> (meta tag for mobile compatibility, 1 link to an external stylesheet, and 2 links to external Javascript files) and 1 line in the <body> (results div).

(Note that the wikiapi.php file is only necessary on my server because I cannot do cross-domain XML requests in Javascript. So the wikiapi.php file simply returns the results of the Wikipedia API results.)

I personally prefer the results being displayed as part of the page, but adding the same effect to a dropdown box is not difficult using For my own personal site I had actually started with that but preferred to opt for the more simplistic version.

I would be happy to help out with this where necessary. Autocomplete for search engines nowadays is basically a must (read more on my thoughts here:

Let me know if there's anything more I can do to help. Thanks!


preilly wrote:

Ross great work!

How hard do you think it would be to remove the dependency on jQuery?

admin wrote:

I updated the page at to be jQuery independent (see the JavaScript file at compared to the old one: ).

I removed a few "nice-ities" such as the window automatically scrolling to the top as well as the colored background on a touch event. They wouldn't be super difficult to add back in but I figured those would be more of a site-wide design rather than through the plugin.

This feature will be launching shortly. Ideally this week.

Feature has been out in production for a bit.