Experiment with Suggestion Searching on Wikipedia

From Nick Jenkins
Jump to: navigation, search

Some screenshots showing experimenting with Suggestion Searching on the English Wikipedia. (If want to know what suggestion searching is, you can play with it on Julien Lemoine's site ). At the bottom of each screenshot image there is an explanation of what's being shown.

Here we have the "no search active" screenshot. The standard search with its "Go" and "Search" buttons has been replaced by something which looks very similar, but which provides suggestion searching, as we shall see.
Here the letter "s" has been typed. The search area expands to show a list of suggested match results. Unfortunately the results are partially truncated, but you get the idea. Putting the mouse cursor over a link shows that link in the address bar at the bottom of the page, and a suggestion can be selected by using the up and down arrow keys.
Here we have typed "sugg" and the autocompletion kicks in, and indicates that we probably want "suggest". We can either ignore the suggestion, or press the right-arrow or end-key to accept it.
Here the word "suggestion" has been typed, and the desired article (second in the list) has been found, and the highlighting has been moved down (using the down arrow key) to select it.
Taken after the previous screenshot, and all that's happened is that we have pressed enter, and it has opened the "Suggestion" article, as per normal.
A screenshot taken in Internet Explorer. As you can see, it works, but there are worse artefacts, as indicated in red by the "1" and "2".
Another artefact, this time in Firefox. This happens when you have some matches, and suddenly jump from X matches to zero matches. There will be a gap of X rows (in this case 3 rows, from the search for "Suggestion", which had 3 possible matches). Not a huge issue, but would be nicer if it didn't happen.
An explanation of how it was done. These screenshots are from a program called Proxomitron, which is a personal proxy server, and it allows you to modify web requests or web pages in interesting ways before your browser sees it. Here we see that a request for suggestion results is being silently redirected from the en.wikipedia.org domain, to Julien's suggestion site. This is required because of JavaScript cross-domain security restrictions.
The other part of how it was done. Here the standard Wikipedia Search box is being replaced with the suggestion search box, and the JavaScripts required for the suggestion search box are being loaded. Lastly the implementation of the "webQuery" function has been replaced with a function that uses a fixed "/suggestion-query.php" path (but which in all other regards is identical to the standard webQuery function).

Hope you enjoyed the experimental screenshots!

All the best,