Move 'search' to the registry subsystem

This continues the effort to separate all registry logic from the deprecated `Server` object.

This depends on #5348, please review that first.