Author: nickpj
Description:
This is an enhancement bug to track the suggestion searching feature request, as
discussed recently on wikitech-l.
To summarize:
- The behaviour of the current MediaWiki search box would change, so that
instead of a straight text field, it would be more akin to an electronic index
that tries to help you find what you are looking for as you type, without
submitting the whole form.
- The user in their preferences would specify (opt-in) that they want to use
suggestion searching. Since suggestion searching uses AJAX, it would probably be
best to default this to being off so that backwards compatibility is retained
for older non-JavaScript browsers, or clients with slow & expensive &
high-latency connections (e.g. mobile phone devices).
- Suggestion searching would show a list of the possible page names matching
what the user has typed thus far (limited to say the top 10 matches, possibly
ranked by popularity).
- As the user types more, the suggestions would become more specific.
- The user is able to arrow up or arrow down through the list of suggestions to
select / highlight their choice.
- Pressing enter should probably open the topmost choice in the list of
suggestions, or the highlighted suggestion (if the first item is not the
highlighted one).
- Potentially the suggestion has autocomplete functionality, whereby the next
few letters are filled in and highlighted where it seems probable that this is
what the user is going to type.
If it helps to visualize what's being described, there are some screenshots to
give an idea of what it could potentially look like here:
http://nickj.org/images/8/80/03-autocompletion-kicks-in.png and here:
http://nickj.org/images/b/b3/04-found-desired-article.png
One potential implementation for this idea would be the server-side program from
Julien Lemoine. A web interface to this program can be accessed at
http://en.suggest.speedblue.org/ (e.g. the current MediaWiki Search box would
behave something like the search box on this site, except integrated into
MediaWiki), and GPL source code can also be downloaded.
However, there are a few things which would be good to see happen to the above
Suggestion Searching to help integrate it into MediaWiki:
- Currently the index generation uses the pages-articles.xml + all-titles-in-ns0
dump files downloaded from download.wikipedia.org. It would probably be better
to be also be able to generate the indexes directly from the database, instead
of requiring a dump stage first. This would probably be faster, and allow sites
which don't currently generate dump files to also use this.
- Currently some articles can't be reached using the search suggest because
they're "masked" by more popular articles. An example for the English Wikipedia
would be the "AM" disambiguation page being masked by the pages that start with
"American" (i.e. you cannot get to the "AM" search result). Potentially the
exact matches could be included in the search result (although _maybe_ they want
to be towards the end of the list if they're less popular articles, since
they're probably not what the user is looking for).
- Currently the index does not include non namespace 0 articles. It would
probably be best to include other namespaces (e.g. Template:, MediaWiki:, Talk:,
etc), so that the suggestion searching box would have "functional-parity" with
the current search box (e.g. should be able to type "Template:Cleanup" into the
search box, and have it appear in the list of possible results).
- Potential case-sensitive ordering of the results. For example, if the user
searches for "Adfa" on the English Wikipedia, it lists three results, including
"ADFA" (listed first) and "Adfa" (the Welsh town, listed later). Should "Adfa"
come first, because it is an exact match for what the user typed?
Version: 1.8.x
Severity: enhancement