Page MenuHomePhabricator

Only 1 of 2 search terms highlighted
Closed, ResolvedPublic

Description

See URL for exact search. In the result list only the second search term "Canada" is highlighted by the first search term "Spekking" (my name) is not visible.

The search result itself is perfect. I expected the first 3 results at least :-)


Version: unspecified
Severity: minor
URL: https://commons.wikimedia.org/w/index.php?title=Special%3ASearch&profile=all&search=spekking+canada&fulltext=Search&srbackend=CirrusSearch

Details

Reference
bz59897

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:35 AM
bzimport added a project: CirrusSearch.
bzimport set Reference to bz59897.
bzimport added a subscriber: Unknown Object (MLST).

I think there are two reasons the old search gets this more right:

  1. Elasticsearch doesn't make any special effort to make sure that all search terms appear in the snippet (or snippets) it selects. I'll have a think about that. lsearchd doesn't make that effort either but in this case it gets lucky because the search terms only appear once in the wikitext. In a sense the wikitext is more information dense then the rendered output. In another sense, though, it throws away lots of information by not rendering templates. You win some and you lose some. In this case we lost.
  2. lsearchd performs a neat trick: if it finds two worth while segments then it returns them otherwise it returns one double length segment. Elasticsearch doesn't have that bit of magic though for what it is worth I've proposed it: https://github.com/elasticsearch/elasticsearch/issues/3776 . I'm not sure it'd help without #1.

In general you can't expect to get all the terms highlighted _but_ you can tell by playing with google that they've implemented both of these things.

@Raymond: I see both search terms shown in bold in Firefox 38.
Can this be closed as "resolved" nowadays?

Deskana claimed this task.