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.
EDIT: Just to be clear, I have two websites (A and B), and I want to be able to search from website A in both website A and B, as well as from website B.
I have created a shared index on my solr server, and articles are getting indexed from two separate web sites just fine, but I can't seem to find the checkmark that says "activate multisearch", so they have currently two different values in the hash field.
I have found these lines in the code, which seems to indicate the option should be there somewhere... Maybe this feature isn't ready yet?
./src/Plugin/search_api/backend/SearchApiSolrBackend.php: $description = $this->t('If you want to index content from multiple sites on a single Solr server, you should enable the multi-site compatibility here. Note, however, that this will completely clear all search indexes (from this site) lying on this server. All content will have to be re-indexed.');
./src/Plugin/search_api/backend/SearchApiSolrBackend.php: '#value' => $this->t('Turn on multi-site compatibility and clear all indexes'),
./src/Plugin/search_api/backend/SearchApiSolrBackend.php: // If multi-site compatibility is enabled, add the site hash and
./src/Utility/Utility.php: * Switches a server to multi-site compatibility mode.
./src/Utility/Utility.php: watchdog_exception('search_api_solr', $e, '%type while attempting to enable multi-site compatibility mode for Solr server @server: !message in %function (line %line of %file).', $variables);
./src/Utility/Utility.php: drupal_set_message(t('An error occured while attempting to enable multi-site compatibility mode for Solr server @server. Check the logs for details.', $variables), 'error');
./src/Utility/Utility.php: drupal_set_message(t('The Solr server was successfully switched to multi-site compatibility mode.'));
Comment | File | Size | Author |
---|---|---|---|
#10 | 2581209_10.patch | 2.26 KB | mkalkbrenner |
Comments
Comment #2
raj45 CreditAttribution: raj45 commentedComment #3
raj45 CreditAttribution: raj45 commentedComment #4
drunken monkeyThe hash is just there to support indexing from several sites to a single Solr server without conflicts. It doesn't allow you to search data from those different servers (in fact, it actively prevents it).
Mutli-site search as a feature is currently not supported by this module, it would take some development (maybe in a separate contrib module) to support this. There are, however, enough alter hooks to make it possible without too much work to implement a primitive multi-site search with some custom code.
PS: Is the "8.x-1.x" version really the correct one?
Comment #5
raj45 CreditAttribution: raj45 commentedComment #6
raj45 CreditAttribution: raj45 commentedI see, thank you so much for taking the time to clarify that.
And you're right, I am not using the dev version of Search API Solr Search, but 8.x-1.0-alpha1. (I am using the dev version of Search API, though.)
Comment #7
drunken monkeyAh, sorry, that wasn't what I meant – I was just wondering if you're using Drupal 7 or really already Drupal 8. (Since the situation is the same in both versions.) It seems I completely overlooked the "D8" in the issue title.
So, we can leave the version at "dev", I'd say, and just make this a feature request, maybe? Or is your question answered and you'd rather have the issue closed?
Also, see #2596421: Add an option to deactivate the site hash filter for one further step towards simple multi-site use cases. (Then you "just" need identical indexes on both sites and the "Entity HTML output" indexed to have something to show for external results.)
Comment #8
drunken monkeyComment #9
mkalkbrennerComment #10
mkalkbrennerIn IRC we agreed on having multi-site support within this backend.
The first step is a clean-up of the configuration form to prepare it for future additions.
Comment #12
drunken monkeyLooks sensible so far, just one thing:
I think you need to add
'multisite'
to theunset()
, too – otherwise those options will be in the configuration twice (probably leading to config schema validation errors, too).Comment #13
mkalkbrennerYou're right, but the unset doesn't seem to work.
See #2685035: Avoid redundant data in configuration
Comment #14
mkalkbrennerDue to the fact that multisite indexing now works i mark this issue as fixed. Having better multisite search results is covered by #2682347: Expose solr-only fields to views.
Comment #16
GGH CreditAttribution: GGH commentedDo we have any documentation / steps to follow for setting up multisite search?
Comment #17
mkalkbrennerhttps://www.drupal.org/docs/8/modules/search-api-solr/search-api-solr-ho...