Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
multisite-logic-reversed.patch | 999 bytes | alexrayu | |
Comments
Comment #1
thePanz CreditAttribution: thePanz commentedIMHO 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).
Comment #2
thePanz CreditAttribution: thePanz commented