Hi Shawn,

Thanks for your reply.  According to the MIGRATE documentation, the split.key 
parameter is required, and removing it returns a missing parameter exception.  
I’ve tried setting the “split.key=DERP_”, and after doing that I still see no 
documents in the destination collection.  Additionally, the CLUSTERSTATUS 
command indicates that the routeRanges using this split key are "routeRanges": 
"16f98178-16f98178", but when I use the split.key=DERP/0!, I get the route 
ranges I expect (80000000-ffffffff on one shard, and 0-7fffffff on the other).

So, to me, it seems like this particular API endpoint does not work.  I’d love 
for someone to prove me wrong.

Thanks,
Matthew

On 6/21/18, 11:02 AM, "Shawn Heisey" <apa...@elyograg.org> wrote:

    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



The content of this email is intended solely for the individual or entity named 
above and access by anyone else is unauthorized. If you are not the intended 
recipient, any disclosure, copying, distribution, or use of the contents of 
this information is prohibited and may be unlawful. If you have received this 
electronic transmission in error, please reply immediately to the sender that 
you have received the message in error, and delete it. Thank you.

Reply via email to