Migrating data to another collection
There are times when migrating data from one collection to another is a good option, for example, if you have data of multiple clients in different shards. Some of the clients are paying for faster searches and more indexing throughput, and you would like to migrate the data of those clients to another collection so that it can be moved to new, more powerful nodes. If we use routing during indexation, Solr has a nice feature for us—the Collections API and its migrate
command. This recipe will show you how to use it.
Getting ready
Before continuing, you should read the Using routing recipe in Chapter 7, In the Cloud. It provides a description on how to use routing, which is essential to fully understand this recipe. We also assume that we have two collections—one called customers
that will hold our data and the second, empty one called important_customers
. Both the collections were created using the same configuration shown in this recipe...