The new mediasearch prototype on commons uses a new api call to combine various calls to the search api in order to make use of structured and category data when searching
If we can use elasticsearch directly instead of constructing a bunch of separate queries to the search api we'll get better performance, get all of the syntax support already in CirrusSearch, and be able to tune our search results better
This basically involves subclassing `CirrusSearch`'s `FullTextQueryBuilder`, and then using the `registerSearchProfiles` hook to load a search profile that'll use the new subclass to use for the File namespace.
Ensure that the new search profile is **not** used by default - instead we need a url param that loads the new profile so we can A/B test it
There may need to be an initial query to wikidata to get entity ids for search terms in order to search images' structured data (and there may need to be extra data passed to elasticsearch from this query in order to help with scoring, but that's out of scope for this initial ticket)
Acceptance criteria:
[] there exists a url param that will cause searching on commons to use an elasticsearch query that emulates the behaviour of the various search api calls now being used by mediasearch
[] ~~search syntax is supported (including keywords/filters (ie gold intitle:gym), quotes, and booleans)~~ (we will need to implement this piece by piece - see https://phabricator.wikimedia.org/T257304)
How to test:
Do a search only in the File namespace, and add `mediasearch=1` to the url. The search results will look the same as normal search, but the actual resultset should be different (and more similar to the search results of mediasearch)