Page MenuHomePhabricator

Extract search result rendering from SpecialSearch
Closed, ResolvedPublic

Description

The current SpecialSearch code is ~1400 lines long, and has a rather hard to follow execution path. To start cleaning this up lets extract some sort of SearchResultHtmlRenderer (name tbd) that can be instantiated and will return the necessary HTML for the result set. Ideally we should be able to have multiple implementations, so that we can swap them out to test new ways of showing things.

Some possible variations from the 'default' render:

  • The top 3 items might have images added to them
  • We might be rendering interwiki results which are a only a list of titles, rather than the full title+snippet+metadata
  • We might be rendering interwiki results that have full metadata, but are shown in a sidebar
  • We might be rendering some sort of image view, which displays a grid of images instead of a list
  • Moar

I don't know if it makes sense to try and build this with OOUI, or just wing it with the Html class.

Event Timeline

Change 322012 had a related patch set uploaded (by EBernhardson):
[WIP] Pull rendering of single result out of SpecialSearch

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

Change 323976 had a related patch set uploaded (by EBernhardson):
Extract 'did you mean' widget out of SpecialSearch

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

Change 322014 had a related patch set uploaded (by EBernhardson):
Extract search form from SpecialSearch into widget

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

Change 322015 had a related patch set uploaded (by EBernhardson):
Extract main search result rendering from SpecialSearch

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

This code should be ready to go now. I've tested it locally with both inline interwiki (textcat), and sidebar interwiki (sister projects). Everything seems to behave the same as before, but in a clearer and more obvious manner.

Deskana moved this task from Uncategorised to Technical on the CirrusSearch board.Dec 8 2016, 6:14 PM

@lindseyanne @dr0ptp4kt Is there anyone in Editing or Reading that's suitably versed in core that could review this? Thanks. :-)

I believe a number of Reading Web engineers have interfaced with search-related things at one point or another. @ovasileva, would it be possible to discuss this with the team for consideration in the forthcoming sprint? @Deskana, with the freeze coming, is the urgency for review-and-merge something like sometime before the next official production train week?

I'm going to copy and paste this verbiage into another task.

@Deskana, with the freeze coming, is the urgency for review-and-merge something like sometime before the next official production train week?

No, not at all. There's no particular need to get it done before the holiday deployment freeze. Some time early next quarter would be fine. :-)

Change 322012 merged by jenkins-bot:
Pull rendering of single result out of SpecialSearch

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

Change 322014 merged by jenkins-bot:
Extract search form from SpecialSearch into widget

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

Change 323976 had a related patch set uploaded (by EBernhardson):
Extract 'did you mean' widget out of SpecialSearch

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

Change 322015 merged by jenkins-bot:
Extract main search result rendering from SpecialSearch

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

Change 323976 merged by jenkins-bot:
Extract 'did you mean' widget out of SpecialSearch

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

Deskana closed this task as Resolved.Jan 30 2017, 6:20 PM