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.'));
CommentFileSizeAuthor
#10 2581209_10.patch2.26 KBmkalkbrenner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

raj45 created an issue. See original summary.

raj45’s picture

Issue summary: View changes
raj45’s picture

Issue summary: View changes
drunken monkey’s picture

The 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?

raj45’s picture

Version: 8.x-1.x-dev » 8.x-1.0-alpha1
raj45’s picture

I 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.)

drunken monkey’s picture

Version: 8.x-1.0-alpha1 » 8.x-1.x-dev

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.)

Ah, 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.)

drunken monkey’s picture

Title: How to enable Solr multisite search in D8? » Support multi-site search
Category: Support request » Feature request
mkalkbrenner’s picture

mkalkbrenner’s picture

Assigned: Unassigned » mkalkbrenner
Status: Active » Needs review
FileSize
2.26 KB

In 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.

  • mkalkbrenner committed c401f74 on 8.x-1.x
    Issue #2581209 by mkalkbrenner: improved multi-site config form
    
drunken monkey’s picture

Looks sensible so far, just one thing:

+++ b/src/Plugin/search_api/backend/SearchApiSolrBackend.php
@@ -358,6 +365,7 @@ class SearchApiSolrBackend extends BackendPluginBase implements SolrBackendInter
+    $values += $values['multisite'];
     $values += !empty($values['autocomplete']) ? $values['autocomplete'] : array();
     unset($values['http'], $values['advanced'], $values['autocomplete']);

I think you need to add 'multisite' to the unset(), too – otherwise those options will be in the configuration twice (probably leading to config schema validation errors, too).

mkalkbrenner’s picture

I think you need to add 'multisite' to the unset(), too – otherwise those options will be in the configuration twice (probably leading to config schema validation errors, too).

You're right, but the unset doesn't seem to work.
See #2685035: Avoid redundant data in configuration

mkalkbrenner’s picture

Status: Needs review » Fixed

Due 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

GGH’s picture

Do we have any documentation / steps to follow for setting up multisite search?

mkalkbrenner’s picture