Jump to content

Cross-wiki Search Result Improvements/self-guided testing

From mediawiki.org

Test out new updates for the search results page

[edit]

This page details a few ways to test out some of the new updates that are planned for the search result page. If you'd like to leave constructive feedback, please do so on the talk page or on the ticket in Phabricator. More information is available on the main page and A/B testing page.

Note: All of the features discussed on this page are currently in a draft state and might not work at all times or as displayed on this page.
* To test the new sister projects in the search results will not be too difficult for those users that are used to manipulating their browser's URL string.
* The explore similar and Wiktionary widget are a bit more complex and you'll need to have a Wikipedia account to use them.
* Not all search queries will return snippet results from the sister projects. Some, all, or none of the projects might display, as it depends on the search query that was entered.

Sister projects

[edit]
Screenshot of sister projects in search results using rainbow as the search term

Base sample url:

In order to get a base URL and page with which to test with, add in a tilde (~) before the search term rainbow in the URL to force the display of the search results page. Currently, using just the term rainbow in a simple search query string will redirect to the page called 'Rainbow' on English Wikipedia.
https://en.wikipedia.org/w/index.php?search=~rainbow&title=Special:Search
Now, add in the portion of the query that will automatically display snippets from the sister projects on the search results page:
&cirrusUserTesting=recall_sidebar_results
This addition will also remove the need to have the tilde in front of the search term. Here's a sample full URL that displays the search results page with the sister project snippets, using the search term rainbow.
https://en.wikipedia.org/wiki/Special:Search?search=rainbow&fulltext=1&cirrusUserTesting=recall_sidebar_results

Change search term:

To update the search term, simply change the search term in the browser's URL. For instance, we're currently using search=rainbow, let's change that to search=butterfly which would make the new URL:
https://en.wikipedia.org/wiki/Special:Search?search=butterfly&fulltext=1&cirrusUserTesting=recall_sidebar_results

Change to a different Wikipedia:

In order to try this out on other language wikis, simply change the language identifier in the browser's URL. Currently, our sample URL is being used to search on English Wikipedia, and we now want to search on German Wikipedia for the city of Munchen. So, change the two letters of en to de and update the search=Munchen query parameter to get a full URL of:
https://de.wikipedia.org/wiki/Special:Search?search=Munchen&fulltext=1&cirrusUserTesting=recall_sidebar_results

Explore similar

[edit]
First draft screenshot of the 'explore similar' search results page functionality
The explore similar functionality will add a link (activated by a mouse hover or click) which will display related pages, categories and a listing of other languages that the article can be read in. To have this functionality built into your logged in experience, you'll need to edit your common.js file. Not sure if you have a common.js file? Make sure you're logged in and then use this url and see if the common.js file needs to be created:
https://en.wikipedia.org/wiki/Special:MyPage/common.js
Go ahead and create it if you need to and then add in the following line and save your common.js file.
importScript( 'User:JDrewniak_(WMF)/exploreSimilarSearchResults.js' );
Now, when you get the search results page from a query, you'll see the 'explore similar' link with each search result.

Wiktionary widget

[edit]
Sample screenshot of Wiktionary widget with rainbow definition
The Wiktionary widget is a cool little experimental API that pulls information from English Wiktionary and will display a variety of things: pronunciation, a short definition, what part of a sentence it is (noun, adjective, verb) and samples of usage. Depending on the word, you might receive all of that information, some of it, or nothing at all - it all depends on what is in Wiktionary for that word.
To get the Wiktionary widget on your search results page, you'll need to find your common.js file as detailed above, add in this line, and save:
importScript( 'User:JDrewniak_(WMF)/wiktionaryDefinitionInSearchResults.js' );