Thanks, Peter,
I am checking that, also UpdateRequest class seems to have methods that
take routes as input. I will see if it helps.

On Tue, Jun 28, 2022 at 3:19 PM Peter Lancaster <
peter.lancas...@findmypast.com> wrote:

> Hi Satya,
>
> I think you would need to use a HttpSolrClient that uses the url of the
> shard where the record exists.
>
> Regards,
> Peter.
>
> -----Original Message-----
> From: Satya Nand <satya.n...@indiamart.com.INVALID>
> Sent: 28 June 2022 10:43
> To: users@solr.apache.org
> Subject: Re: Delete by Id in solr cloud
>
> EXTERNAL SENDER: Do not click any links or open any attachments unless you
> trust the sender and know the content is safe.
>
>
> 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://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsolr.apache.org%2Fdocs%2F8_1_0%2Fsolr-solrj%2Forg%2Fapache%2Fsolr%2Fclient%2Fsolrj%2Fimpl%2FCloudSolrClient.html&amp;data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&amp;reserved=0
> deleteById
> <
> https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsolr.apache.org%2Fdocs%2F7_3_1%2Fsolr-solrj%2Forg%2Fapache%2Fsolr%2Fclient%2Fsolrj%2FSolrClient.html%23deleteById-java.lang.String-java.util.List-int-&amp;data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&amp;reserved=0
> >
> (String
> <
> https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.oracle.com%2Fjavase%2F8%2Fdocs%2Fapi%2Fjava%2Flang%2FString.html%3Fis-external%3Dtrue&amp;data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&amp;reserved=0
> >
>  collection, List
> <
> https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.oracle.com%2Fjavase%2F8%2Fdocs%2Fapi%2Fjava%2Futil%2FList.html%3Fis-external%3Dtrue&amp;data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&amp;reserved=0
> >
> <String
> <
> https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.oracle.com%2Fjavase%2F8%2Fdocs%2Fapi%2Fjava%2Flang%2FString.html%3Fis-external%3Dtrue&amp;data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&amp;reserved=0
> >>
> 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
> > https://gbr01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsemat
> > ext.com%2F&amp;data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71
> > d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> > %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5
> > T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&amp;reserved=0
> >
> >
> > 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?
> > >
> >
>
> ________________________________
>
> This message is private and confidential. If you have received this
> message in error, please notify us immediately by emailing
> postmas...@findmypast.com and remove it from your system.
> This email is not intended to create legally binding obligations unless
> expressly stated otherwise. We accept no liability for the content of this
> email, or for the consequences of any actions taken based on the
> information provided, unless that information is subsequently confirmed in
> writing. Any views or opinions presented in this email are solely those of
> the author and do not necessarily represent those of the company. We have
> taken reasonable precautions to ensure that no viruses are contained in
> this email, but do not accept any responsibility once this email has been
> transmitted. You should ensure that the email and attachments (if any) are
> virus free. We may monitor email traffic data and also the content of email
> using data loss prevention software for the purposes of data security.
>
> Findmypast
> Clerk’s Court
> First Floor, 18-20 Farringdon Lane
> London
> EC1R 3AU
>
> Registered in England, no. 4369607
>

Reply via email to