Josh
Josh

Reputation: 828

Solr - Migrate Documents from one Collection to another existing one

I need to move all Solr Documents from one collection to another (already existing collection) - there are 500,000 documents.

I have tried the solr migrate but cannot get the routing key correct. I have tried:

curl 'http://localhost:8983/solr/admin/collections?action=MIGRATE&collection=oldCollection&target.collection=newCollection&split.key=!'

I have solr 4.10.3 installed in a cloudera installation.

Upvotes: 0

Views: 6113

Answers (2)

Yatin
Yatin

Reputation: 697

The answer and the question are quite old, starting from 8.1 solr version, there is a feature specific for this purpose which is the reindexcollection api which can directly be used to reindex docs from source to a target collection with a lot of configurable options. Here is the link to the official doc : https://lucene.apache.org/solr/guide/8_1/collections-api.html#reindexcollection

Upvotes: 1

Abhijit Bashetti
Abhijit Bashetti

Reputation: 8658

Copy your existing oldCollection, and rename the as newCollection, After that you may need to update some config files for the same.

Or create a new one using the below api https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api1

Upvotes: 2

Related Questions