Our Magento module IntegerNet_Solr supports Solr’s feature of core swaps. The search index can be replaced by a new index without having any negative side effects on the customer experience in a Magento store’s search.
During a core swap two separate Solr cores change their responsibilities. A second ago, it was Core1 that replied to search requests and Core2 was occupied with the indexing, Core1 and Core2 now change their tasks as soon as Core2 has completed the indexing process.
Advantages of Solr core swaps
Using the new index, Core 2 is able to answer search requests with even more recent results than Core1. Therefore, Core2 now transmits the search results to Magento. In the meantime, you can delete the old index of Core1 and initiate a new indexing process. Although the indexing running, users do not experience any limitations. For them, the search function in Magento is available at any time. The Solr search engine has no downtime.
Separate Solr cores offer further benefits
Separate Solr cores have the great advantage that the core used by Magento is solely responsible for answering search requests. No ressources are blocked by the indexing. The search results can be displayed even faster in the Magento online store. Plus, you can update the second core and run tests before making these changes visible to users of the Magento store and without limiting the Solr search for website visitors.
Use cases for Solr core swaps in Magento
A simple setup usually does not require a complete indexing because the Solr index is updated on the fly after each product change initiated in the Magento backend. However, in some cases a regular or irregular complete indexing is a sensible choice:
- After product imports that include a major or highly relevant part of the store’s products
- After product imports that make use of an import feature which is incompatible with Magento’s index functions (e.g. using Magento’s built-in CSV import “ImportExport”)
- When the store consists of a great number of StoreViews, which means that each save process of a product in Magento’s backend leads to several Solr requests to perform an update. In this case, the current index would be deactivated (under System -> Index Management in Magento’s backend).
This normally does not only apply to the Solr index but all indexes in Magento. Thanks to the swap function there are no consequences observable for store customers when the Solr index is emptied at the beginning of the complete indexing.
Especially when the online store is used by international customers who order around the clock, this is important because such stores have no time window for nightly downtime which could be used for indexing.
As soon as the indexing is finished by one core, the swap is performed automatically. Our module IntegerNet_Solr supports this automated swap, so no manual administrative operations are necessary.
Different approach for SolrCloud
In rare cases Solr is implemented as a cloud based solution called SolrCloud. In such a setup, which is suitable for websites of the size of Wikipedia, a simple core swap is not possible. Instead a workaround is necessary to receive the same result. However, for almost all online shops a regular setup of Solr is preferable to SolrCloud.
Further information about the features of IntegerNet_Solr are summarised on the page Features.