Page MenuHomePhabricator

VisualEditor's Add a link should suggest a redirect with exact case match
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

If the marked text in VisualEditor's "Add a link" feature is an exact case match to a page name then that name should be shown in the suggestions whether or not it's a redirect and whether or not there is another redirect with different capitalization.

On enwiki, "United States of America" and "United states of america" are redirects to "United States".
If you start VisualEditor's Add a link feature on the chain icon with "United States of America" then the suggestions include the poorly capitalized redirect "United states of america" but not the better "United States of America" as you started with (see screenshot). You can create that link by clicking "Done" or pressing Enter but users may not know that, and they cannot see it will work or where it will go. A non-existing page name would look the same in the feature but produce a red link on "Done".

VE Add a link.png (696×412 px, 42 KB)

The issue was brought up at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Strange_linkages,_piping_through_miscapitalized_redirects (permanent link, archived discussion)

The missing suggestion causes many VE users to make pointless piped links like [[United states of america|United States of America]] (example)
It probably also causes many VE users to waste time looking for a way to make the link they wanted.

Event Timeline

Great spot and thank you for filing this issue, @PrimeHunter.

The issue here seems to be that the search API is not returning the results we expect. @Esanders is going to follow up with a search sandbox demonstrating the issue.

This came to the attention of the Search Platform team during our triage. It looks like we make some assumptions about how we handle redirects that are non optimal. This has been the case since probably > 8 years, not something that changed or broke recently. It might be that the features in VE are making this more visible. This is probably something that could be improve and would benefit Search more generally, but would require some investigation and design.

We're unsure of the priority of this. Guidance from Editing-team would be welcomed!

Search Platform will spend some time to understand the problem better and see if we can come up with a solution.

We will discuss this in more details during our Wednesday meeting.

Gehel set the point value for this task to 3.Oct 16 2023, 3:24 PM

Change 967472 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/core@master] search: prefer user typed form when re-ranking a redirect to the top

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

Change 967472 merged by jenkins-bot:

[mediawiki/core@master] search: prefer user typed form when re-ranking a redirect to the top

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