In Special:Search, the parameter srbackend can used to specify an alternative search engine (like CirrusSearch during a transition phase): see SpecialSearch.php.
This parameter is not taken into account in 1.36-alpha (but it works in 1.33).
In Special:Search, the parameter srbackend can used to specify an alternative search engine (like CirrusSearch during a transition phase): see SpecialSearch.php.
This parameter is not taken into account in 1.36-alpha (but it works in 1.33).
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Restore the parameter srbackend in Special:Search | mediawiki/core | master | +24 -1 |
Tracking a bit this issue, it appears the issue lays in order of operations in the class SpecialSearch:
The order of operations was changed in rMW4d9d61460d9420cc184c22243b0da81855e8f3a1 because getSearchEngine() is now used sooner.
A fix is to move the $this->searchEngineType = $request->getVal( 'srbackend' ); sooner, either at the beginning of execute() either at the beginning of load().
Poke @EBernhardson as author of the commit: you have probably a better idea than me on how to fix it properly.
Looking at this it seems like setting searchEngineType so late is unintentional. Moving it to the top of load() seems the most sensible, it matches the purpose stated in the doc comment. Might be nice to also add a test case that verifies the appropriate search engine is chosen.
Change 672661 had a related patch set uploaded (by Seb35; owner: Seb35):
[mediawiki/core@master] Restore the parameter srbackend in Special:Search
I added you as reviewer @EBernhardson. The patch implements the description you did, I hope the quality is sufficient.
Change 672661 merged by jenkins-bot:
[mediawiki/core@master] Restore the parameter srbackend in Special:Search