This is a skeletal task for implementing a network client for the new search Desktop Improvements Project / FAWG search experience. The interface approach taken by Popups ([[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Popups/+/76e02fa/src/gateway/rest.js | RESTBase ]] / [[ https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Popups/+/76e02fa/src/gateway/mediawiki.js | Action ]] ) seems to have worked well and allows the underlying service to be swapped between the Action API, RESTBase, and mocked data so it should probably be considered for this task.
=== Questions
- Are the client responses [[ https://he.wikipedia.org/wiki/%D7%9E%D7%93%D7%99%D7%94_%D7%95%D7%99%D7%A7%D7%99:Gadget-Dwim.js | DWIM ]] compatible? If not, should we modify the gadget? If so, do we need a gadget API?
- Is the caching sensible? For example, if a user types "f", "o", "o", <backspace>, can the browser served cached results for "fo"?
- Do we need an A/B test for the network clients?
- What types are nullable, undefined, or missing? It's not yet [[ https://www.mediawiki.org/wiki/Core_Platform_Team/Initiatives/Core_REST_API_in_MediaWiki/Schema | documented ]] as far as I can tell.
=== Docs and examples
https://www.mediawiki.org/wiki/API:REST_API/Search
https://en.wikipedia.beta.wmflabs.org/w/rest.php/coredev/v0/search/page?q=foo ("search pages containing ...")
https://en.wikipedia.beta.wmflabs.org/w/rest.php/coredev/v0/search/title?q=foo (search by title for typeahead)
== Acceptance criteria
- [] Compare to the [[ https://en.wikipedia.beta.wmflabs.org/w/api.php?format=json&formatversion=2&action=query&prop=pageimages%7Cdescription&uselang=content&smaxage=300&maxage=300&generator=prefixsearch&pilicense=any&piprop=thumbnail&pithumbsize=160&gpssearch=red | Action API ]] and Portals implementation.