Namespace selection code is duplicated between init and namespace providers. There should be a central class that provides the namespaces available for search.
This is a followup for T173736: Create a namespace checkbox for "General Help" and should have been part of that ticket.