If you have multiple publishing targets in your Sitecore CMS, you will need to test them before publishing. This includes testing your website's search functionality.
Not to worry. We will guide you. Follow along!
Setting Up Publishing Targets
Create multiple Search Apps for each Publish Target as you wish by following the instructions for the Sitecore Module.
Create Index cores for each Search App.
Once you have created the indexes, your config file will be updated with the indexes you created.
Go to the config fileSearchStax.Connector.Provider.config at ~/App_Config\Modules\SearchStax.
In the config file, you will see multiple indexes created along with crawler nodes. Go to the section and update the database name. By default, it points to web.
Save the file and restart the server or AppService.
Once the configuration step is done, you need to repopulate your schemas and rebuild your indexes.
Testing the Configuration
Now you can create search pages and configure respective indexes on those pages and test the search functionality.