On 6/21/2018 7:08 AM, Matthew Faw wrote:
For background, I’m using solr version 7.3.1 and lucene version 7.3.1

I have a solr collection with 2 shards and 3 replicas using the compositeId 
router.  Each solr document has “id” as its unique key, where each id is of 
format DERP_${X}, where ${X} is some 24 character alphanumerical string.  I 
create this collection in the following way:

curl 
"http://localhost:8983/solr/admin/collections?action=CREATE&name=derp&collection.configName=derp&numShards=2&replicationFactor=3&maxShardsPerNode=0&autoAddReplicas=true";

Suppose I have some other collection named herp, created in the same fashion, 
and a collection named blurp, with 1 shard, but otherwise created in the same 
fashion.  Also suppose that there are 2000 documents in the derp collection, 
but none in the herp or blurp collections.

I’ve been attempting to do two things with the MIGRATE Collections API:

   1.  Migrate all documents from the derp collection to the herp collection 
using the following command:
curl 
"http://localhost:8983/solr/admin/collections?action=MIGRATE&collection=derp&target.collection=herp&split.key=DERP/0\!&async=30";
 | jq
   2.  Migrate all documents from the derp collection to the blurp collection 
using the same MIGRATE command, swapping herp for blurp.

(I chose split.key=DERP/0! With the intent of capturing all documents in my 
source collection, since the /0 should tell the migrate command to only look at 
the hash of the id field, since I’m not using a shard key).

The Collections API documentation doesn't mention any ability to use /N with split.key.  Which may mean that it is looking for the literal text "DERP/0!" or "DERP/0\!" in your source documents, and since it's not there, not choosing any documents to migrate.  The reason I have mentioned two possible strings there is that the ! character doesn't need escaping in a URL.  The URL encoded version of that string is this:

DERP%2f0!

Because you want to choose all documents, I don't think you need the split.key parameter for this, or that you may need to use split.key=DERP_ instead.  Because you're not using routing prefixes in your indexing, I am leading more towards just removing the parameter entirely.

I have never actually used the MIGRATE action.  So I'm basing all this on the documentation.

Thanks,
Shawn

Reply via email to