Page MenuHomePhabricator

SimpleSearch Suggestions match highlighting broken
Closed, DeclinedPublic

Description

Author: howiewiki

Description:
Please see: http://meta.wikimedia.org/wiki/2010_Wikimedia_design_and_feature_change/Bug_reports#Search_works_incorrectly_with_brackets_and_hyphen

Search suggestions are displayed incorrectly, though the links appear to work properly. The following is copied from the report on meta:

Expected behavior
If one types some search query with brackets or hyphen, old search usually ignored these symbols and offered variants both with and without these symbols

Observed behavior
Also new search does ignore these symbols, suggestions are displayed incorrectly. All of them tend to have the same symbol on the place of a bracket or a hyphen, which may be different for different suggestions. For example, Динамо Київ was typed on screenshot 1, the bottom variant really is Динамо Київ (журнал), although the top one is different, it is Динамо (Київ), incorrectly displayed as Динамо Київв). Same for screenshot 2, all links but the bottom one begin with Динамо (с, the bottom one begins with Динамо-С, and this variant is copied for other variants. However, links are correct

Steps to reproduce
Type any search query where some of the suggestions have brackets and/or hyphen and some not

Here are direct links to screenshots:
http://meta.wikimedia.org/wiki/File:VectorSearchBug1.jpg
http://meta.wikimedia.org/wiki/File:VectorSearchBug2.jpg


Version: unspecified
Severity: major

Details

Reference
bz24237

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
DeclinedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:11 PM
bzimport set Reference to bz24237.
bzimport added a subscriber: Unknown Object (MLST).

Simpler test case (dot versus space) reported at http://en.wikipedia.org/wiki/Wikipedia:VPL#Vector_search_dot_.28._period.29_suggestions .

This is a weird one. I've looked at the JSON returned from opensearch and that data is correct. Something in our suggestions plugin is rewriting these things somehow.

  • Bug 24390 has been marked as a duplicate of this bug. ***
  • Bug 24329 has been marked as a duplicate of this bug. ***
  • Bug 24282 has been marked as a duplicate of this bug. ***

For more interesting examples, look no further than the duplicates listed above.

  • Bug 24233 has been marked as a duplicate of this bug. ***
  • Bug 24226 has been marked as a duplicate of this bug. ***

mattnashbrowns wrote:

Introduction of a comma also changes results, but a non-alpha character isn't necessary. Try "Springfield I" and "Springfield, I" for an example of this behavior.

Got it. the problem is in jquery.suggestions.js

within configure, case suggestions:

autoEllipsis() gets passed "matchedText". matchedText is always the text of the last suggestion in the list, with the substr length of context.data.prevText.length. So for "Doctor Who (" the last suggestion is "Doctor Who and the Silurians" and the matched text that is passed to autoellipsis is "Doctor Who a". If you add a breakpoint, you can actually see that during the building of the list of suggestions, "matchedText" is continuously updated to the last processed suggestion.

amiller1 wrote:

I have this fixed and have asked Roan and/or Trevor to review and deploy it. Waiting on them. Sorry I didn't see this bug earlier to update you all.

Ok, it's a lot better now. But try this:

"Doctor Who (TV series"

result

<b>Doctor Who</b> (TV <b>series</b>

This last issue still exist.

Thehelpfulonewiki wrote:

Reassign to default per bug 37789

I cannot reproduce any of the problems listed here with the Search on en.wikipedia.org, uk.wikipedia.org or sv.wikipedia.org.

I assume this has been fixed in the meantime, but please reopen this ticket and provide an example and an URL where to still see this.