Page MenuHomePhabricator

Use SearchMappings in MW Core
Open, LowPublic

Description

T250977: Decouple $wgSearchType/$wgSearchTypeAlternatives from PHP class added mapping functionality to allow extensions to decouple $wgSearchType/$wgSearchTypeAlternatives from the underlying PHP class using ObjectFactory specification

However, it didn't give mappings for classes in MW core that are subclasses of SearchDatabase etc in core

Obviously this isn't a problem atm, but at some point SearchMySQL will be namespaced too, and we don't want to keep aliases around for ever, and similar to T250812: Deal with dropping of Global CirrusSearch class, we don't want to have to have $wgSearchType/$wgSearchTypeAlternatives set to 'MediaWiki\Search\MySQL' etc (it's not exactly great in the current state in the API either - where you can end up being able to pass srbackend=SearchMySQL), so having mappings for something like 'mysql' => 'SearchMySQL' in the mix would make sense, and then being able to set $wgSearchType/$wgSearchTypeAlternatives to 'mysql' (and 'SearchMySQL' for back compat for some time?)