The top-right (in Vector) search widget is a pretty simple form that submits to Special:Search.
We would need that to submit to Special:MediaSearch, with the correct params.
- The target of the form (or rather, the value `title`) must become Special:MediaSearch
- The search input field must change from "search" to "q" (or alternatively, Special:MediaSearch must change from "q" to "search" - whichever makes most sense)
At first sight, it looks like the form(s) are in:
- /includes/skins/templates/fallback/skin.mustache (default)
- /skins/Vector/includes/templates/SearchBox.mustache (Vector)
- Possibly other files for other skins
Given how they're spread across multiple files, I suspect we won't want to change their markup. Odds are also pretty good that there are assumptions in scripts (extensions, gadgets...)
The data for the form, however, seems to come from /includes/skins/SkinMustache.php, in a method called `buildSearchProps`, which is called from `getTemplateData`.
It seems like this is where we'll want to make the requisite changes, except that there doesn't (at first sight) appears to be an easy way to get in there.
//Suggestion (in case there is in fact no existing way to modify from the outside): hooks also seem to be the de facto way to customize skins, judging from the amount of hooks already in Skin.php. It should be fairly easy to add a hook there, which WikibaseMediaInfo (or MediaSearch) can then hook into to override the target & search field.//
Here is where we'll have to figure out what to do with the "search" or "q" field.
From this same place in the code, we could easily swap out the "search" input for "q", but other code might depend on this thing being called "q".
I'd be quite surprised if that were the case, but if so, we'll either have to start adjusting those - or simply fall back to updating Special:MediaSearch to operate on another query param...
 The top-right search (in Vector skin) search widget must, when filled in & submitted, kick of the search in Special:MediaSearch
 The top-left search (in Monobook skin) search widget must, when filled in & submitted, kick of the search in Special:MediaSearch
 Autocomplete etc. (e.g. prefix searches, see T240404) must continue to work as they always did