Page MenuHomePhabricator

Sort by filter for Media Search
Closed, ResolvedPublic

Description

Sort by filter that defaults to "relevancy" which is our current ranking but also allows seeing the results ordered by "Most recent" (based on date posted) or "Most Viewed".

As a Commons user, I want to be able to sort search results by different criteria.

Acceptance Criteria:

  • A "Sort by" filter is added that allows users to change the order of search results
  • The sort filter would appear on all tabs
  • The sort filter should have the following options:
    • "Relevancy" (default)
    • "Recency" (based on date posted)
    • "Popularity"
  • The sort filter should match the following design on desktop. This task does not cover the mobile UI (this will be done as part of T258615)

filters.jpg (755×1 px, 335 KB)

Event Timeline

This ticket is blocked by T258063. Once the A/B test is complete (T254388) and we've confirmed that we're moving forward with the new profile, we can move forward with T258063 and begin work on this ticket.

"most recent" and "most viewed" imply things about the implementation.
We can rescore results, but that's no guarantee that they'd be in that exact order, because we don't necessarily want a super popular image that is a poor match for the search term to outrank a near perfect match that is a little less popular.
I propose we rephrase the options to "relevance", "recency" and "popularity" to be less suggestive about the exact implementation.
PS: if we're going with popular: there is a rescore profile that uses both pageviews and incoming links to rank things by - that would probably be an even better one to use.

I propose we rephrase the options to "relevance", "recency" and "popularity" to be less suggestive about the exact implementation.

After talking to @Ramsey-WMF I updated the description to incorporate this - thanks for the suggestion!

PS: if we're going with popular: there is a rescore profile that uses both pageviews and incoming links to rank things by - that would probably be an even better one to use.

This seems like a good idea to me too.

I've started implementing this and noticed that the results with the default sort and results with gsrqiprofile = popular_inclinks_pv are identical.

Sandbox example with popular_inclinks_pv profile
Sandbox example with default profile

@matthiasmullie any idea what's going on here? Is there something I'm missing?

I suppose it's possible that the results aren't always totally identical and that the default relevance sort and the popular profile are just really similar. If that's the case, we should probably rethink including the popularity sort option.

1 thing is missing from your links: to be able to use the media search profile right now, you'll need to add ?mediasearch=1 to the url (and API sandbox keep stripping it, apparently)

But yeah, it looks like the profiles are working, but the differences are minimal (only 1 difference in the first 10 results)
I guess it's a result of the current weights overpowering the popularity-based rescore - I'll file a separate ticket to fix those weights (or if we can't, reconsider the popularity sort)

@AnneT I'd suggest to use the popular_inclinks profile for now.

popular_inclinks_pv seems to add only a minor score, but popular_inclinks does have a massive impact.

The one that also includes pageviews doesn't count incoming links as much, and the pageviews seem too scattered (too many files, almost none have a significant enough amount of pageviews) to have an impact on most queries...

The other one's only based on incoming links, though, not incoming links + pageviews; but a good enough proxy for 'popularity' none the less.

We can then use T262511 to further investigate the impact of these rescore profiles, and/or what kind of other work is needed (if any)

Change 626493 had a related patch set uploaded (by Anne Tomasevich; owner: Anne Tomasevich):
[mediawiki/extensions/WikibaseMediaInfo@master] Add sort filter to all tabs

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

Change 626493 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Add sort filter to all tabs

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

Checked in commons wmf.9