lando / solr

The Official Solr Lando Plugin
https://docs.lando.dev/solr/
GNU General Public License v3.0
0 stars 8 forks source link

Two sites sharing a single Solr core possible? #5

Open gitressa opened 4 years ago

gitressa commented 4 years ago

Has anyone managed to get Drupal 8 Search API Solr multisite feature, sharing a single Solr core, running in Lando? Just to be clear, this is not a Drupal multisite installation, but two separate web sites, sharing a single Solr core, to be able to index and search in both sites, on either web site.

I am fine with both these scenarios, whichever is easier to set up:

gitressa commented 4 years ago

I am glad to see a milestone have been added :+1:

It seems to almost work, though I am not sure if Lando, Drupal or Solr is the issue ... I have created two individual Lando instances, which share a single Solr core. They can connect and index to this core, when they are both running, or individually.

From web site A (218 nodes) search index admin page:

218/218 indexed
...
Server index status   There are 431 items indexed on the server for this index.

I get suggestions (using the Search API Autocomplete module) from Solr indexed content from both web sites.

Before clearing all indexed data (218/218 indexed), number of indexed words getting suggested in an autocomplete enabled search field:

The search result will show link to nodes of current web site A, links to web site B are missing.

After clearing all indexed data (0/218 indexed), numbers of hits are reduced, as expected:

The search result now shows no links at all, also as expected. From the logs of web site A: Drupal\search_api\SearchApiException: The datasource with ID '2xkmvb--entity:node' could not be retrieved for index 'Search index'. in Drupal\search_api\Entity\Index->getDatasource() (line 369 of /app/web/modules/contrib/search_api/src/Entity/Index.php).

Web site B logs are all about The datasource with ID '31hyfe--entity:node' ....

Also, it seems like the Solr core from the Lando instance which was started first comes first in the alphabet is receiving the indexed data, if that makes sense. So, if only web site B is running, its Solr core will be indexed to. But as soon as web site A is started, it will take over, from both web site A and B.

Web site A http://admin.websitea.lndo.site/solr/#/absearch/core-overview Num Docs: 431

Web site B http://admin.websiteb.lndo.site/solr/#/absearch/core-overview Num Docs: 0

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

gitressa commented 3 years ago

Thanks Stalebot, but this issue is still relevant.