Page MenuHomePhabricator

Show Wikidata entity thumbnails in Abstract Wikipedia search suggestions
Closed, ResolvedPublic

Description

In resources/ext.wikilambda.search/wikidata.js, the wbsearchentities API is called to power the Abstract Wikipedia search suggestions, but we currently do not request or display thumbnail images.

Wikidata's wbsearchentities API supports a props parameter that can include url (already used) but thumbnail data is available via a separate action=query&prop=pageimages call. We should fetch and display the entity thumbnail in the Vector typeahead search suggestions, consistent with how standard MediaWiki search displays page thumbnails.

What needs to change:

  • In requestWikidataEntitySearch(), add support for fetching thumbnail URLs alongside entity data (via action=query&prop=pageimages on Wikidata)
  • Pass the thumbnail URL through transformEntityToResult() into the search result object
  • Ensure the Vector search client receives and renders the thumbnail

Event Timeline

Implementation note — API research

Investigated whether Wikidata entity search and thumbnails can be fetched in a single API call.

Conclusion: two separate calls are required.

  • wbsearchentities is a standalone action (action=wbsearchentities), not a list module under action=query, so it cannot be used as a generator.
  • Its props parameter only supports url — no thumbnail or image fields.
  • action=query&prop=pageimages cannot be combined with wbsearchentities for the same reason.

The only alternative would be action=query&generator=search&prop=pageimages (MediaWiki full-text search as generator), but that uses a different search engine that doesn't do label/alias matching in the user's language — result quality would be significantly worse.

Implementation approach: The two calls (wbsearchentities for entity search, action=query&prop=pageimages for thumbnails) are fired in parallel via Promise.all, so there is no additional latency penalty. This is implemented in resources/ext.wikilambda.search/wikidata.js.

Change #1271817 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] Search: Show Wikidata entity thumbnails in AW search suggestions

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

Jdforrester-WMF changed the task status from Open to In Progress.Apr 15 2026, 5:12 PM
Jdforrester-WMF assigned this task to DSmit-WMF.
Jdforrester-WMF triaged this task as Medium priority.

Change #1271817 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Search: Show Wikidata entity thumbnails in AW search suggestions

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