Page MenuHomePhabricator

Search results show the label twice, but not the item description.
Closed, ResolvedPublic

Description

The excerpt shown on search results shows item labels twice. It would be more useful to see the item description (aka tag line) there.


Version: unspecified
Severity: normal

Details

Reference
bz41580

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:58 AM
bzimport set Reference to bz41580.
bzimport added a subscriber: Unknown Object (MLST).
daniel created this task.Oct 31 2012, 10:59 AM
daniel added a comment.Nov 6 2012, 1:19 PM

It's not showing the label twice, it's looking at getTextForSearchIndex() and highlighting the first two occurrences of the search term. The description doesn't come into this at all.

We'll need new hooks in core to solve this, plus possibly more functionality in the Content class.

daniel added a comment.Nov 6 2012, 1:19 PM

Partial fix provided by I9158684b together with I75a78293: this will show the description along with the label and the ID. Showing better excerpts is still pending.

daniel added a comment.Nov 6 2012, 1:30 PM

Thinking about it, the above fix should be good enough for now. It removes the spurious excerpts and shows the description.

Showing excerpts from items may be nice for phase two, but that's a separate feature request.

daniel added a comment.Nov 6 2012, 3:16 PM

Oops, forgot to submit my last update, useless extracts are still show. Follow-up fix: I29074acf

Now if you search for an alias you don't see that alias in the search results which is confusing because you don't know why the specific item was found.

Selenium tests are failing bacause of this. I'm going to remove the lines which check if the actual search term is displayed in the search results.

@Tobias: good point. there's already a TODO in the code for showing something meaningful there, but maybe we should have a ticket open for "show context of matching search terms in search result". The problem is that in the past, the text that was used for highlighting was just a list of all the labels, descriptions, aliases and site link targets, without any real context. Just the terms. That's not really helpful, and looks confusing; typically it would just show the search term twice, without any actual context. I'm not sure what the context should really look like... should it say something like "Dutch Alias: Foo", or "Link to German Wikipedia: Baar"? That would be nice, but it's not trivial to do (though the code could be re-used to show nicer context for diffs too: "German Descripion" instead of "description/de").

Restricted Application added a project: Wikidata. · View Herald TranscriptJan 28 2016, 6:11 PM
Restricted Application added a subscriber: StudiesWorld. · View Herald Transcript