Hi Radu,

I am using solrj for executing the query. I couldn't find any function with
accepts additional parameters like routing, shards, solr Params etc.

I also tried delete by query instead of deleteById, But it is very slow.

https://solr.apache.org/docs/8_1_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html
deleteById
<https://solr.apache.org/docs/7_3_1/solr-solrj/org/apache/solr/client/solrj/SolrClient.html#deleteById-java.lang.String-java.util.List-int->
(String
<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true>
 collection, List
<https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true>
<String
<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true>>
ids,
int commitWithinMs)




On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <radu.gheor...@sematext.com>
wrote:

> Hi Satya,
>
> I didn't try it, but does it work if you add "shards=shard1,shard2..." to
> the request?
>
> Worst case scenario, if you have the address of each shard (you can get it
> from Zookeeper), you can run the delete command N times, one hitting each
> shard address.
>
> Best regards,
> Radu
> --
> Elasticsearch/OpenSearch & Solr Consulting, Production Support & Training
> Sematext Cloud - Full Stack Observability
> http://sematext.com/
>
>
> On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <satya.n...@indiamart.com
> .invalid>
> wrote:
>
> > Hi,
> >
> > I have an 8 shards collection, where I am using *compositeId* routing
> > with *router.field
> > *(a field named parentglUsrId). The unique Id of the collection is a
> > different field *displayid*.
> >
> > I am trying a delete by id operation where I pass a list of displayids to
> > delete. I observed that no documents are being deleted. when I checked
> the
> > logs I found that the deletion request for an Id might not go to the
> > correct shard and perform a request on some other shard that was not
> > hosting this Id. This might be due to solr trying to find the shard based
> > on the hash of displayid but my sharding is done on the basis of
> > parentglUsrId.
> >
> >
> > is there anything I am missing? Because it seems like a simple operation.
> > what do I need to do to broadcast a delete by id request to all shards so
> > relevant id can be deleted on each shard?
> >
>

Reply via email to