On a setup of sites running solr from the same index, searches from different sites end up showing. Having a look at the code revealed, that when the hash is added to query when $multisite is empty. This seems to be a logic error. When $multisite is not empty, the hash should be added. Fixing this logic corrects the site behavior.

Please review the patch and confirm if this issue.

CommentFileSizeAuthor
multisite-logic-reversed.patch999 bytesalexrayu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thePanz’s picture

IMHO the logic is correct.
Your SOLR index contains *all* the sites contents (tems/fields/etc).

If a site Z is "multi-site" enabled all the searches will return results from all the SOLR indexed sites; in this case the SOLR Query does NOT contain any HASH restriction.

If a site X is NOT "multi-site" the logic is that such site won't participate in the multi-site environment, thus the searches performed in site X must return only documents of site X. In this case a search query sent to SOLR from site X will contain a filter parameter to only retrieve documents with the site X hash.

In conclusion: the multisite search logic is correct (imho).

thePanz’s picture

Status: Needs review » Closed (works as designed)