Search queries might return no results or outdated results after rebuilding search indexes. The issue affects Sitecore instances that are configured to use SolrCloud. The root cause of the issue is that the name of the active Solr collection is resolved using data from the Properties table of the Core database of the Sitecore indexing instance. If the name of the instance changes, then the existing property is ignored.
To resolve the issue, set the value of the InstanceName setting for your indexing instance explicitly by creating a configuration patch file in the \App_Config\Include\zzz folder (refer to paragraph 1).
Note
If the value of the InstanceName setting is not specified, its value is based on Environment.MachineName-HostingEnvironment.SiteName. To avoid changes in the property name when the machine name changes, you must specify a unique (in the scope of the environment) name for the instance that is responsible for indexing. Other Sitecore instances read data by referencing the main alias.