This depends a little on your client implementation. Typically, the search functionality is exposed on an XMPP domain by some subdomain (search.mydomain.org). If you want to use the search functionality on another domain, your client should simply address the search functionality of that domain by address.