Page MenuHomePhabricator

Implement search result fields augmentation approach in SearchHandler
Closed, ResolvedPublic5 Estimated Story Points

Description

Motivation

Once the technical approach from T250139 is confirmed, It should be implemented in code.

  • Add 2 hooks (naming TBD on gerrit review): "provideThumbnailsForPages" and "provideDescriptionForPages".
  • Contract for hooks the following: [ &$pageIds ], where $pageIds is an array of pageId=>null. Provided should amend it setting a value for a certain pageId instead of null.
  • provideThumbnailsForPages should provide objects of type ThumbnalInfo (exact type or name of class, or whatever it is TBD)
  • provideDescriptionForPages should provide objects of type string
  • SearchHandler (or some class in the 'core') should serialize the info provided by hooks in a proper way and augment the proper fields if the results with it.

Expected result

  • Hooks should be introduced
  • Tests that verifies that hooks are called in a proper way should be added
  • Augmentation logic that merges results with info provided from hooks should be implemented
  • Bot integration and Unit Tests that verifies the augmentation logic should be provided

Related Objects

Event Timeline

Peter.ovchyn updated the task description. (Show Details)
Peter.ovchyn set the point value for this task to 5.

Change 588999 had a related patch set uploaded (by Peter.ovchyn; owner: Peter.ovchyn):
[mediawiki/core@master] rest: WIP! Add 'thumbnail' and 'description' fields to the search response

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

@daniel You wanted to have a strict type for thumbnails and serialize it in the core. Should I create something like ThumbnailValue?

@daniel You wanted to have a strict type for thumbnails and serialize it in the core. Should I create something like ThumbnailValue?

Yes, please. Though I'm wondering whether this should be specific to the search domain, to avoid over-generalizing. So perhaps we should call it something like SearchResultThumbnail.

Change 588999 merged by jenkins-bot:
[mediawiki/core@master] rest: Add 'thumbnail' and 'description' fields to the search response

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