You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Satya Nand <sa...@indiamart.com.INVALID> on 2022/06/28 04:55:17 UTC
Delete by Id in solr cloud
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?
Re: Delete by Id in solr cloud
Posted by Satya Nand <sa...@indiamart.com.INVALID>.
Hi Peter,
I have tried using httpsolrclient. but the receiving shard also forwards
the request to some other shard. Is there any way we can achieve this solr
8.7 ?
On Thu, Jun 30, 2022 at 3:41 AM r ohara <ro...@gmail.com> wrote:
> Hi Satya,
> I think it's a bug with using compositeId. We had the same issue, and had
> to use deleteByQuery instead, but like you said, it's much slower. We're
> using solr 8.11
>
> On Tue, Jun 28, 2022 at 4:59 AM Satya Nand <satya.nand@indiamart.com
> .invalid>
> wrote:
>
> > 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.lancaster@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 <sa...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&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-&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&reserved=0
> > > >>
> > > ids,
> > > int commitWithinMs)
> > >
> > >
> > >
> > >
> > > On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <
> > radu.gheorghe@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com
> %7C52e71
> > > >
> d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> > > >
> %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > >
> IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5
> > > > T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&reserved=0
> > > >
> > > >
> > > > On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <satya.nand@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
> > > postmaster@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
> > >
> >
>
Re: Delete by Id in solr cloud
Posted by Jeryl Cook <tw...@gmail.com>.
Unsubscribe
On Thu, Jun 30, 2022, 6:58 AM Satya Nand <sa...@indiamart.com.invalid>
wrote:
> Hi, r ohara,
>
> Yeah, I found the bug id:https://issues.apache.org/jira/browse/SOLR-8889.
> seems like it was fixed in solr 8.10 and 9.
>
> so nothing worked besides using delete by query?
>
> On Thu, Jun 30, 2022 at 3:41 AM r ohara <ro...@gmail.com> wrote:
>
> > Hi Satya,
> > I think it's a bug with using compositeId. We had the same issue, and had
> > to use deleteByQuery instead, but like you said, it's much slower. We're
> > using solr 8.11
> >
> > On Tue, Jun 28, 2022 at 4:59 AM Satya Nand <satya.nand@indiamart.com
> > .invalid>
> > wrote:
> >
> > > 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.lancaster@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 <sa...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&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-&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&reserved=0
> > > > >>
> > > > ids,
> > > > int commitWithinMs)
> > > >
> > > >
> > > >
> > > >
> > > > On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <
> > > radu.gheorghe@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com
> > %7C52e71
> > > > >
> > d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> > > > >
> > %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > > >
> > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5
> > > > > T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&reserved=0
> > > > >
> > > > >
> > > > > On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <
> satya.nand@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
> > > > postmaster@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
> > > >
> > >
> >
>
Re: Delete by Id in solr cloud
Posted by Satya Nand <sa...@indiamart.com.INVALID>.
Hi, r ohara,
Yeah, I found the bug id:https://issues.apache.org/jira/browse/SOLR-8889.
seems like it was fixed in solr 8.10 and 9.
so nothing worked besides using delete by query?
On Thu, Jun 30, 2022 at 3:41 AM r ohara <ro...@gmail.com> wrote:
> Hi Satya,
> I think it's a bug with using compositeId. We had the same issue, and had
> to use deleteByQuery instead, but like you said, it's much slower. We're
> using solr 8.11
>
> On Tue, Jun 28, 2022 at 4:59 AM Satya Nand <satya.nand@indiamart.com
> .invalid>
> wrote:
>
> > 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.lancaster@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 <sa...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&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-&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&reserved=0
> > > >>
> > > ids,
> > > int commitWithinMs)
> > >
> > >
> > >
> > >
> > > On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <
> > radu.gheorghe@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com
> %7C52e71
> > > >
> d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> > > >
> %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > >
> IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5
> > > > T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&reserved=0
> > > >
> > > >
> > > > On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <satya.nand@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
> > > postmaster@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
> > >
> >
>
Re: Delete by Id in solr cloud
Posted by r ohara <ro...@gmail.com>.
Hi Satya,
I think it's a bug with using compositeId. We had the same issue, and had
to use deleteByQuery instead, but like you said, it's much slower. We're
using solr 8.11
On Tue, Jun 28, 2022 at 4:59 AM Satya Nand <sa...@indiamart.com.invalid>
wrote:
> 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.lancaster@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 <sa...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&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-&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&reserved=0
> > >>
> > ids,
> > int commitWithinMs)
> >
> >
> >
> >
> > On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <
> radu.gheorghe@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71
> > > d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> > > %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5
> > > T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&reserved=0
> > >
> > >
> > > On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <satya.nand@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
> > postmaster@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
> >
>
Re: Delete by Id in solr cloud
Posted by Satya Nand <sa...@indiamart.com.INVALID>.
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.lancaster@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 <sa...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&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-&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&reserved=0
> >>
> ids,
> int commitWithinMs)
>
>
>
>
> On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <radu.gheorghe@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71
> > d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> > %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5
> > T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&reserved=0
> >
> >
> > On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <satya.nand@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
> postmaster@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
>
RE: Delete by Id in solr cloud
Posted by Peter Lancaster <pe...@findmypast.com>.
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 <sa...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4d7N5LCpx8TXnEv7GW%2BN2TmoE8YvHa0tgr4c%2FamgOBw%3D&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-&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MdBKsoMlbTqUjx5xzUny1Hrop0La2cwkg6cVZgZ76Es%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bUQ0Fe0pPkP2kFeRy%2BLg%2FuTIBSEM1HVQdk4EEAdQYCQ%3D&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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0%7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3gPAaYNOQvAkYD8coSuGjm28gau5i3lEJabT4Kqu%2BCk%3D&reserved=0>>
ids,
int commitWithinMs)
On Tue, Jun 28, 2022 at 12:58 PM Radu Gheorghe <ra...@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&data=05%7C01%7Cpeter.lancaster%40findmypast.com%7C52e71
> d1ca9294234c62808da58eaa4a0%7C75e41e0807c2445db397039b2b54c244%7C0%7C0
> %7C637920062049080011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5
> T28n9NppzIpUi9MaWeF1ZYcQuh%2FreGX2iVvsDczleI%3D&reserved=0
>
>
> On Tue, Jun 28, 2022 at 7:55 AM Satya Nand <satya.nand@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 postmaster@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
Re: Delete by Id in solr cloud
Posted by Satya Nand <sa...@indiamart.com.INVALID>.
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 <ra...@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.nand@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?
> >
>
Re: Delete by Id in solr cloud
Posted by Radu Gheorghe <ra...@sematext.com>.
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 <sa...@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?
>