Page MenuHomePhabricator

[Semantic Search] Make # contributors available to search results
Closed, ResolvedPublic1 Estimated Story Points

Description

Search results are supposed to display the amount of contributors on a page (see figma)
To the best of my knowledge, this is not currently available from the action API (which is used to get search results alongside additional relevant result data)

It appears that Extension:WikimediaCustomizations intends to provide an article's contributor count through their REST API (on a per-article basis), but it does not look like that is currently implemented.
If at the time of picking up this ticket, this has become available, we can easily take the same approach as T438420 (possibly even getting both at the same time)
Or else implement it there ourselves.

NOTE: Above is supposed to be implemented now and expected to be deployed next week (and IIRC the repo already contains a placeholder for this data). We can just use that and it'll automatically start working soon (if not already by the time this is picked up). We can piggy-back on T438420: [Semantic Search] Make # references available to search results which is already executing this API call.

Another alternative could be api.php?prop=contributors, whose data could easily be added to the initial search api.php request. Sadly, the total contributor count is not there: there is an anonymous contributor count, and a list of all named contributors (but that's not one we can use because it requires paging, i.e. loads of additional API request). At first glance, it looks like it would be quite trivial to add an absolute contributor count value to this API's output.

Alternatively, we might be able to do direct database queries from our own REST API endpoint (at time of writing ticket: MediaWiki\Extension\ReaderExperiments\Experiments\SemanticSearch\Rest\GetSemanticSearch)

If that all fails, let's discuss options with @JScherer-WMF. E.g. is showing only anonymous contributor (already available through api.php?prop=contributors count an option?

Event Timeline

SherryYang-WMF lowered the priority of this task from Medium to Low.Sep 23 2026, 5:16 PM
SherryYang-WMF set the point value for this task to 5.
matthiasmullie removed the point value 5 for this task.Oct 6 2026, 3:29 PM
SherryYang-WMF set the point value for this task to 1.Oct 6 2026, 4:41 PM
SherryYang-WMF changed the task status from Open to Stalled.Oct 6 2026, 5:03 PM
SherryYang-WMF changed the task status from Stalled to In Progress.Tue, Oct 13, 11:29 PM

Per this conversation in Slack, we will use contributor_counts.total_unique to display as the contributor count to align with the current app experience. We do not need to exclude known_bots for this implementation.

example response:

contributor_counts":{"total_unique":4248,"logged_in_users":2628,"unregistered_users":1504,"known_bots":115}

Change #1356412 had a related patch set uploaded (by Nick Battista; author: Nick Battista):

[mediawiki/extensions/ReaderExperiments@master] Semantic Search: display contributor count

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

Change #1356412 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Semantic Search: display contributor count

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