Swap cores when reindexing

Created on 10 June 2020, over 4 years ago
Updated 13 March 2024, 9 months ago

If we want to reindex without disrupting production results, Solr lets us swap cores, whereby we index on one core that's not serving results then swap it with the one that is. The Sitecore CMS offers automatic integration with that functionality: https://doc.sitecore.com/developers/93/platform-administration-and-archi... .

Could this capability be integrated into the Search API Solr module?

✨ Feature request
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SpaceGoat1701

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I arrive to the same issue, is there any advance or update on this ?
    If I have the two solrs cores and I set one as read only, can I reindex to the second one and then just swap them?
    Or there is any issue with that ?

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    #8 is still valid

  • πŸ‡«πŸ‡·France duaelfr Montpellier, France

    Hi @mkalkbrenner and thanks for your work here!
    I was trying to solve this using a dead simple trick that was to use env vars to set the core name in the settings.local.php.
    I was hoping to be able to run a drush sapi-i call with the env var but as this rely on the search_api_item database table, I wasn't able to do that that simply.
    Would you provide some guidance either to find a workaround or implement that swapping feature in the module, please? I'm willing to provide a patch but I'm not sure I wouldn't loose myself without at least a starting point.
    Thanks again!

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    Basically you need to configure two search_api servers, having identical search_api indexes. (For sure the IDs will be different).
    You could name one server "search server", the other one "index server".
    The search server indexes should be set to read only and all search views should be configured to use this one.

    Both servers should be configured to use their own Solr core or Solr Cloud collection.
    Now you can use The SWAP command from the Solr Core API or work with ALIAS from the Solr Collection API to perform the swap.

Production build 0.71.5 2024