Search Index
The following are some best practices for optimal index replication and search request distribution in a search server cluster.
Setting job intervals
The index builder jobs are configured to execute on an hourly basis. You may want to adjust this interval depending on the size of your indexes and the frequency of updates. For example, use a larger interval for a large number of indexes. Frequent index builds can affect performance, so we recommend that you experiment to determine the optimal interval that balances the frequency of updates and performance.
When the script is run, it will only duplicate an index if it has changed. Therefore, you may set a lower interval without the additional overhead of duplicating unchanged indexes.
Primary/replica load distribution
Although the primary search server is capable of handling search requests from Cortex and Commerce Manager, we recommend that only the replica machines handle requests. There are two reasons for this:
Ensure consistency in search results
Due to the replication process, there is a delay between the time the primary search server indexes a new object and the time it becomes searchable on the replica server. If requests only go to the replica servers, the delay will be consistent and all objects will appear at the same time once they have been indexed and replicated on all replica servers.
Reduce load on the primary server, allowing it to focus on continuous indexing
Restoring From Backup Index
If a bad index has been replicated from the primary server to the replica servers, you can fix it by restoring a backup index on the primary server. If replication is on, any changes to the primary index will be replicated to the replica.
note
When restoring from backup, you must shutdown and restart the primary server for replication to work properly.
For example, to restore the product index from a backup:
Shutdown the primary search server.
Delete the primary’s product index located in your deployed search server’s
WEB-INF\solrHome\data\index-product
folder.Copy your backup product index files to
solrHome\data\index-product
.Restart the primary server.