You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by philippa griggs <ph...@hotmail.co.uk> on 2017/02/28 11:39:24 UTC

Implicit routing, delete on specific shard

Hello,


Solr 5.4.1 using Solr Cloud, multiple cores with two cores per shard. Zookeeper 3.4.6   (5 zookeeper ensemble).

We use an implicit router and split shards into weeks. Every now and again I need to run a delete on the system.  I do this by running the following command on one of the instances.

curl http://127.0.0.1:8983/solr/collection1/update/?commit=false -H "Content-Type: text/xml" -d "<delete><query>XXX</query></delete>"


Is there anyway of specifying the shards to run the delete on, instead of running it against the whole collection? I will always know what shards the sessions I want to delete will be on.

I know when you query, you can do something like this:

http://XXX:8983/solr/collection1/select?q=*%3A*&wt=json&indent=true&shard=20170220

Is there similar function with the delete?

Something like:

curl http://127.0.0.1:8983/solr/collection1/update/?commit=false -H "Content-Type: text/xml" -d "<delete><query>XXX</query></delete>" -shard "20170220"

Many thanks

Philippa


Re: Implicit routing, delete on specific shard

Posted by Damien Kamerman <da...@gmail.com>.
I assume with the implicit router you would do something like curl "
http://127.0.0.1:8983/solr/collection1_20170220_replica1/update?commit=
false"

On 28 February 2017 at 22:39, philippa griggs <philippa.griggs@hotmail.co.uk
> wrote:

> Hello,
>
>
> Solr 5.4.1 using Solr Cloud, multiple cores with two cores per shard.
> Zookeeper 3.4.6   (5 zookeeper ensemble).
>
> We use an implicit router and split shards into weeks. Every now and again
> I need to run a delete on the system.  I do this by running the following
> command on one of the instances.
>
> curl http://127.0.0.1:8983/solr/collection1/update/?commit=false -H
> "Content-Type: text/xml" -d "<delete><query>XXX</query></delete>"
>
>
> Is there anyway of specifying the shards to run the delete on, instead of
> running it against the whole collection? I will always know what shards the
> sessions I want to delete will be on.
>
> I know when you query, you can do something like this:
>
> http://XXX:8983/solr/collection1/select?q=*%3A*&wt=json&indent=true&shard=
> 20170220
>
> Is there similar function with the delete?
>
> Something like:
>
> curl http://127.0.0.1:8983/solr/collection1/update/?commit=false -H
> "Content-Type: text/xml" -d "<delete><query>XXX</query></delete>" -shard
> "20170220"
>
> Many thanks
>
> Philippa
>
>