Sometimes, you may notice that indexing your site has undesired effects on the indexes of other sites in your Site Factory. Incorrect or incomplete results may appear, or you may encounter issues with the pagination of results. The root of the issue is often polluted data within the core, caused by sites sharing the same Solr core, but not having unique hash values to differentiate them.
You can check the has values of your sites like so (below example is for Drupal 8):
$ drush cget search_api_solr.settings --uri=https://www.myfirstexamplesite.com/ --include-overridden include-overridden last_optimize: 0 index_prefix: '' cron_action: spellcheck site_hash: [hash value 1] <--- Unique hash value 1 _core: default_config_hash: xxxxxxxxxxxx
$ drush cget search_api_solr.settings --uri=https://www.mysecondexamplesite.com/ --include-overridden include-overridden last_optimize: 0 index_prefix: '' cron_action: spellcheck site_hash: [hash value 2] <--- Unique hash value 2 _core: default_config_hash: xxxxxxxxxxxx
Our recommendation would be to set a unique value in your existing
factory-hooks/post-settings-php/includes.php. You can do that with the following piece of code:
$config['search_api_solr.settings']['site_hash'] = $GLOBALS['gardens_site_settings']['conf']['acsf_db_name'];
Please note that carrying out the above will require you to reindex ALL your sites.
Prior to reindexing and after you have put the above code in
post-settings-php you will need to completely wipe the index. Should you require further help with that, please file a support ticket.
Bear in mind that the hash will be the same across all your stages, that said as different cores are used for each stage, results will not get mixed up.
$GLOBALS['gardens_site_settings']['conf']['acsf_db_name'] example is just one way of ensuring that your
site_hash is unique. Feel free to use any unique variable you prefer.