Page MenuHomePhabricator

Search suggestions should only highlight the first match in the title
Closed, ResolvedPublic

Description

Strings that occur twice in a name of an article are highlighted twice.
Steps to reproduce:

Go to the English wikipedia, and type

A: *A*frican *A*merican (U.S. Census) is highlighted
B: *BB*C is highlighted
J J: *J*. *J*onah *J*ameson

Or go to the German wikipedia type
Br: *Br*itish *Br*oadcasting Corporation is highlighted

Expected behavior: Only the first occurrence of the letters typed in should get highlighted.


Version: 1.22.0
Severity: enhancement

Details

Reference
bz25187

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:20 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz25187.
bzimport added a subscriber: Unknown Object (MLST).
Schnark created this task.Sep 16 2010, 10:32 AM

Thehelpfulonewiki wrote:

Reassign to default per bug 37789

SimpleSearch issues => Moving to Vector (as per $wgVectorUseSimpleSearch)

The whole mess is actually in core.

(This is still happening, as described in comment 0.)

maddiemadan wrote:

The bug is still reproducible. All the occurrences gets highlighted.

Created attachment 16337
Screenshot of bug.

Attached:

Krinkle removed a subscriber: Krinkle.Jul 23 2016, 12:42 AM
Restricted Application added projects: Discovery, Discovery-Search. · View Herald TranscriptJul 23 2016, 12:42 AM
Krinkle set Security to None.
Krinkle removed a subscriber: wikibugs-l-list.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJul 23 2016, 12:42 AM
TJones added a subscriber: TJones.Sep 12 2016, 3:02 PM

Is this really a bug? It seems like a preference. I personally prefer all instances of my search string to be highlighted. It's a little silly when your query-so-far is only one letter, but it's not bad when you have longer strings.

I might argue that only the last word in the query should make a partial-word match, so that when searching for a ma only the whole word a should be highlighted (rather than both intial a's in A Matter of Life and Death.

On the other hand, maybe people do search for partial words (spelling is often hard), and so even the partial matches are useful (when they are more than one letter). Stranger things have happened.

debt closed this task as Invalid.Sep 12 2016, 4:24 PM
debt added a subscriber: debt.

Hi @Schnark - I'm closing this ticket as 'invalid' due to it appears to be a preference related issue rather than a bug.

I think this is a valid issue with MediaWiki core's built-in search suggestions, which are just a simple prefix search, so it doesn't make sense to highlight anything other than the prefix.

For CirrusSearch, the default highlights are in fact not smart enough (e.g. they don't account for misspelling correction or accent folding), and the highlighting would have to be done server-side anyway to make any sense (T62976).

Schnark reopened this task as Open.Sep 13 2016, 7:37 AM

As matmarex said: This is a prefix search. It makes sense to highlight the prefix, but if the search term occurs somewhere later in the title, this is just a coincidence. It also makes it hard to see which letter you should type next:

To continue, you have to type "n", though the next letter following the highlighted part is an "o".

Deskana lowered the priority of this task from Low to Lowest.Sep 13 2016, 8:54 PM
Deskana added a subscriber: Deskana.

Given that this box performs a prefix search on article titles, I agree that this behaviour is unintuitive. That said, this isn't a super pressing issue; it's unintuitive and somewhat misleading, but it's not particularly incorrect. Lowering priority accordingly.

Aklapper added a subscriber: Aklapper.

Previous comments imply that this is not non-controversial, hence removing good first bug tag.
I see the same behavior when using "Modern" instead of "Vector" skin hence removing the Vector project tag.

matmarex claimed this task.Dec 17 2016, 3:55 AM

Change 327900 had a related patch set uploaded (by Bartosz Dziewoński):
jquery.suggestions: Only highlight prefix matches

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

Change 327900 merged by jenkins-bot:
jquery.suggestions: Only highlight prefix matches

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

matmarex closed this task as Resolved.Feb 6 2017, 8:03 PM
matmarex removed a project: Patch-For-Review.