Page MenuHomePhabricator

Prefer pages in the user's language in multilingual wikis
Closed, ResolvedPublic

Description

As an Italian user using Italian language interface on a multilingual wiki, I expect Italian and English results (in this order) to come first.

"Italian and English" results here is defined by the [[mw:page content language]], which is currently set only by Translate. See for instance https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Installation/it&action=info which is in Italian.

I suppose this requires storing the language of the document, which should be easy enough I think, and might later be used for fancier things (bug 54832).


Version: master
Severity: enhancement
URL: https://www.mediawiki.org/w/index.php?title=Special%3ASearch&search=memcached+prefix%3Ahelp%3Aextension%3Atranslate&go=Vai

Details

Reference
bz66829
Related Gerrit Patches:

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:25 AM
bzimport added projects: CirrusSearch, I18n.
bzimport set Reference to bz66829.
bzimport added a subscriber: Unknown Object (MLST).
Nemo_bis created this task.Jun 19 2014, 8:50 AM

Change 140866 had a related patch set uploaded by Chad:
Prefer articles in a user's language on multilingual wikis

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

Change 140866 merged by jenkins-bot:
Prefer articles in a user's language on multilingual wikis

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

I'm not sure this still works, https://www.mediawiki.org/w/index.php?title=Special%3ASearch&profile=default&search=throttle+prefix%3AManual%3APywikibot&fulltext=Search&uselang=it shows [[Manual:Pywikibot/Global Options/it]] only as 5th result for me, preceded by English and Catalan.

Spage added a subscriber: Spage.EditedJul 24 2015, 9:24 PM

Reopening, search result set and ordering on mw.org seems identical regardless of language preference or uselang=langcode Compare "badtoken" search with "badtoken" search with uselang=fr.

I'm not sure this still works, https://www.mediawiki.org/w/index.php?title=Special%3ASearch&profile=default&search=throttle+prefix%3AManual%3APywikibot&fulltext=Search&uselang=it shows [[Manual:Pywikibot/Global Options/it]] only as 5th result for me, preceded by English and Catalan.

Restricted Application added a project: Discovery. · View Herald TranscriptJul 24 2015, 9:24 PM
Spage reopened this task as Open.Jul 24 2015, 9:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 24 2015, 9:24 PM
Nemo_bis triaged this task as Normal priority.Jul 25 2015, 12:26 PM
Nemo_bis set Security to None.
Ironholds moved this task from Needs triage to Search on the Discovery board.Aug 4 2015, 8:17 AM
demon removed a subscriber: demon.Aug 19 2015, 4:06 PM
jayvdb awarded a token.Oct 8 2015, 7:59 PM
jayvdb added a subscriber: jayvdb.
Tuxxic added a subscriber: Tuxxic.Oct 10 2016, 3:26 PM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptOct 10 2016, 3:26 PM

Change 315532 had a related patch set uploaded (by EBernhardson):
Prefer pages in the user's language in multilingual wikis

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

afaict the support was added to cirrussearch but never turned on anywhere, above patch turns it on for mediawiki.org with fairly arbitrarily chosen weights.

Change 315532 merged by jenkins-bot:
Prefer pages in the user's language in multilingual wikis

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

deployed. The results are better, but never perfect. The problem is that the weight on incoming_links can, in some cases, overweight the language based rescore. So for the example query above:

https://www.mediawiki.org/w/index.php?title=Special%3ASearch&profile=default&search=throttle+prefix%3AManual%3APywikibot&fulltext=Search&uselang=it&cirrusDumpResult&cirrusExplain=pretty

Pywikibot/Global Options

text based scoring: 0.05815
incoming links weight: 2.576
language:en weight: 2.5
final score: 0.37453112

Pywikibot/Global Options/it

text based scoring:  0.05815
incoming links weight: 0.90309
language:it weight: 5.0
final score: 0.26257026
Nemo_bis added a comment.EditedOct 12 2016, 8:21 PM

Now my first example search gives, in order:

Help:Extension:Translate/Installation
Help:Extension:Translate/Components
Help:Extension:Translate/Installation/it
Help:Extension:Translate/Installation/en

And the second:

Manual:Pywikibot/Global Options
Manual:Pywikibot/Global Options/it
Manual:Pywikibot/Global Options/en
Manual:Pywikibot/login.py/it
Manual:Pywikibot/login.py

This at least makes sense, because my interface language and the original language come before any other translation. So we could generously consider this task fixed (though the broader goal T56832 isn't), but it would be wise to keep track of your finding somewhere, e.g. to decide whether to revise the language weight; and perhaps it's another task to avoid showing the original language twice.

debt added a subscriber: debt.

Cool - closing this ticket as resolved and opened T148207 for further investigation later on.

debt closed this task as Resolved.Oct 14 2016, 5:29 PM
debt claimed this task.
debt moved this task from Backlog to Done on the Discovery-Analysis (Current work) board.
Nemo_bis added a subscriber: TJones.Jun 6 2018, 8:51 AM

@TJones do we have any kind of test to verify that this keeps working as expected? Currently I'm unable to verify it's still fixed.

Restricted Application added a project: Product-Analytics. · View Herald TranscriptJun 6 2018, 8:51 AM
dcausse added a subscriber: dcausse.Jun 6 2018, 2:36 PM

As pointed out by Erik the number of incoming links can sometimes overweight language preferences (this is especially true when using special keywords as they change the scoring formula). I have some hope that can unify the scoring behaviors with and without keywords in the query.
Without any keywords in the query I can see language preference in effect:

But when a keyword is here the effect of the language preference is diminished this is perhaps why you don't see it in effect?
This should be more consistent I hope once we've done refactoring how we handle the query in Cirrus.

TJones added a comment.Jun 7 2018, 2:45 PM

@Nemo_bis, I hope @dcausse answered your question. The pages related to Manual:Pywikibot/login.py are good examples, since the /en and /it pages are currently almost identical, since only the "See also" section has been translated.