Re: Can we delete documents based on an Id
Lahiru Gunathilake <[email protected]> Mon, 28 Feb 2011 20:21:43 +0530
| Newsgroups | gmane.text.xml.xindice.user |
|---|---|
| Message-ID | <[email protected]> |
--0015175cb82e769d65049d58d115 Content-Type: text/plain; charset=ISO-8859-1 Hi Natalia, Cool thats a valid usecase and I prefer add a sample with this in to DeleteDocument.java file. I will do my contribution once I am done with these work. Regards Lahiru On Mon, Feb 28, 2011 at 7:53 PM, Natalia Shilenkova <[email protected]>wrote: > Lahiru, > > Yes, the id and the document key is the same thing. Basically, when a > resource is created, it gets assigned an id that can be used later to > retrieve or delete that document. > > Regards, > Natalia > > On Mon, Feb 28, 2011 at 7:20 AM, Lahiru Gunathilake <[email protected]> > wrote: > > Hi Natalia, > > Thanks Natalia for the response. what do you mean by key, Is it the Id of > > the document or can you please tell me how to get his key. > > I believe its the id like for a documents there's method getId(), can you > > please confirm is that what you are referring as key ? > > Regards > > Lahiru > > > > On Mon, Feb 28, 2011 at 5:35 PM, Natalia Shilenkova < > [email protected]> > > wrote: > >> > >> On Feb 25, 2011, at 11:09 AM, Lahiru Gunathilake wrote: > >> > >> Hi Devs, > >> Is there a way to delete an added resource based on an ID. My > requirement > >> is like this. > >> I am pumping in the incoming xml content to xindice while storing them > in > >> to a repository and when user try to remove a resource from repository i > >> need to remove that from the xindice too, otherwise I am keeping > unnecessary > >> data on the db. By looking at your API's i couldn't find a way to remove > the > >> content by parsing an ID, but during adding the resource I can keep a > list > >> of ID's i have added to xindice. > >> Do you have any solution for this or is there any other way to achieve > >> this ? > >> > >> Lahiru, > >> As far as I understand, you need something like this: > >> String key; // document key > >> Resource res = collection.getResource(key); > >> collection.removeResource(res); > >> This will delete the document from the collection. > >> Regards, > >> Natalia > >> > >> Regards > >> Lahiru > >> > >> -- > >> Lahiru Gunathilake > >> Senior Software Engineer - WSO2 Inc. www.wso2.com > >> > >> Email:[email protected] Blog: www.lahiru.org > >> Mobile: +94716381143 > >> > >> Lean . Enterprise . Middleware > >> > >> > > > > > > > > -- > > Lahiru Gunathilake > > Senior Software Engineer - WSO2 Inc. www.wso2.com > > > > Email:[email protected] Blog: www.lahiru.org > > Mobile: +94716381143 > > > > Lean . Enterprise . Middleware > > > > > -- Lahiru Gunathilake Senior Software Engineer - WSO2 Inc. www.wso2.com Email:[email protected] Blog: www.lahiru.org Mobile: +94716381143 Lean . Enterprise . Middleware --0015175cb82e769d65049d58d115 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div>Hi Natalia,</div><div><br></div>Cool thats a valid usecase and I prefe= r add a sample with this in to DeleteDocument.java file. I will do my contr= ibution once I am done with these work.<div><br></div><div>Regards</div> <div>Lahiru<br><br><div class=3D"gmail_quote">On Mon, Feb 28, 2011 at 7:53 = PM, Natalia Shilenkova <span dir=3D"ltr"><<a href=3D"mailto:nshilenkova@= gmail.com">[email protected]</a>></span> wrote:<br><blockquote class= =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd= ing-left:1ex;"> Lahiru,<br> <br> Yes, the id and the document key is the same thing. Basically, when a<br> resource is created, it gets assigned an id that can be used later to<br> retrieve or delete that document.<br> <br> Regards,<br> <font color=3D"#888888">Natalia<br> </font><div><div></div><div class=3D"h5"><br> On Mon, Feb 28, 2011 at 7:20 AM, Lahiru Gunathilake <<a href=3D"mailto:l= [email protected]">[email protected]</a>> wrote:<br> > Hi Natalia,<br> > Thanks Natalia for the response. what do you mean by key, Is it the Id= of<br> > the document or can =A0you please tell me how to get his key.<br> > I believe its the id like for a documents there's method getId(), = can you<br> > please confirm is that what you are=A0referring=A0as key ?<br> > Regards<br> > Lahiru<br> ><br> > On Mon, Feb 28, 2011 at 5:35 PM, Natalia Shilenkova <<a href=3D"mai= lto:[email protected]">[email protected]</a>><br> > wrote:<br> >><br> >> On Feb 25, 2011, at 11:09 AM, Lahiru Gunathilake wrote:<br> >><br> >> Hi Devs,<br> >> Is there a way to delete an added resource based on an ID. My requ= irement<br> >> is like this.<br> >> I am pumping in the incoming xml content to xindice while storing = them in<br> >> to a repository and when user try to remove a resource from reposi= tory i<br> >> need to remove that from the xindice too, otherwise I am keeping u= nnecessary<br> >> data on the db. By looking at your API's i couldn't find a= way to remove the<br> >> content by parsing an ID, but during adding the resource I can kee= p a list<br> >> of ID's i have added to xindice.<br> >> Do you have any solution for this or is there any other way to ach= ieve<br> >> this ?<br> >><br> >> Lahiru,<br> >> As far as I understand, you need something like this:<br> >> String key; // document key<br> >> Resource res =3D collection.getResource(key);<br> >> collection.removeResource(res);<br> >> This will delete the document from the collection.<br> >> Regards,<br> >> Natalia<br> >><br> >> Regards<br> >> Lahiru<br> >><br> >> --<br> >> Lahiru Gunathilake<br> >> Senior Software Engineer - WSO2 Inc. <a href=3D"http://www.wso2.co= m" target=3D"_blank">www.wso2.com</a><br> >><br> >> <a href=3D"mailto:Email%[email protected]">Email:[email protected]</= a> Blog: <a href=3D"http://www.lahiru.org" target=3D"_blank">www.lahiru.org= </a><br> >> Mobile: +94716381143<br> >><br> >> Lean . Enterprise . Middleware<br> >><br> >><br> ><br> ><br> ><br> > --<br> > Lahiru Gunathilake<br> > Senior Software Engineer - WSO2 Inc. <a href=3D"http://www.wso2.com" t= arget=3D"_blank">www.wso2.com</a><br> ><br> > <a href=3D"mailto:Email%[email protected]">Email:[email protected]</a> B= log: <a href=3D"http://www.lahiru.org" target=3D"_blank">www.lahiru.org</a>= <br> > Mobile: +94716381143<br> ><br> > Lean . Enterprise . Middleware<br> ><br> ><br> </div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Lahiru Guna= thilake<br>Senior Software Engineer - WSO2 Inc. <a href=3D"http://www.wso2.= com">www.wso2.com</a><br><br><a href=3D"mailto:Email%[email protected]">Ema= il:[email protected]</a> Blog: <a href=3D"http://www.lahiru.org">www.lahiru.o= rg</a><br> Mobile: +94716381143<br><br>Lean . Enterprise . Middleware<br><br> </div> --0015175cb82e769d65049d58d115--