Re: Can we delete documents based on an Id

Lahiru Gunathilake <[email protected]> Mon, 28 Feb 2011 17:50:51 +0530
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
--001517503ba6e3a36a049d56b509
Content-Type: text/plain; charset=ISO-8859-1

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

--001517503ba6e3a36a049d56b509
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Natalia,<div><br></div><div>Thanks Natalia for the response. what do you=
 mean by key, Is it the Id of the document or can =A0you please tell me how=
 to get his key.</div><div><br></div><div>I believe its the id like for a d=
ocuments there&#39;s method getId(), can you please confirm is that what yo=
u are=A0referring=A0as key ?</div>
<div><br></div><div>Regards</div><div>Lahiru<br><br><div class=3D"gmail_quo=
te">On Mon, Feb 28, 2011 at 5:35 PM, Natalia Shilenkova <span dir=3D"ltr">&=
lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt;</=
span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;"><div style=3D"word-wrap:break-word"><br><di=
v><div class=3D"im"><div>On Feb 25, 2011, at 11:09 AM, Lahiru Gunathilake w=
rote:</div>
<br><blockquote type=3D"cite">Hi Devs,<div><br></div><div>Is there a way to=
 delete an added resource based on an ID. My requirement is like this.</div=
><div><br></div><div>I am pumping in the incoming xml content to xindice wh=
ile 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&#39;s i couldn&#=
39;t find a way to remove the content by parsing an ID, but during adding t=
he resource I can keep a list of ID&#39;s i have added to xindice.</div>

<div><br></div><div>Do you have any solution for this or is there any other=
 way to achieve this ?</div></blockquote><div><br></div></div><div>Lahiru,<=
/div><div><br></div><div>As far as I understand, you need something like th=
is:</div>
<div><br></div><div>String key; // document key</div><div><div>Resource res=
 =3D collection.getResource(key);</div><div>collection.removeResource(res);=
</div><div><br></div><div>This will delete the document from the collection=
.</div>
<div><br></div><div>Regards,</div><div>Natalia</div></div><div class=3D"im"=
><br><blockquote type=3D"cite"><div><br></div><div>Regards</div><div>Lahiru=
<br clear=3D"all"><br>-- <br>Lahiru Gunathilake<br>Senior Software Engineer=
 - WSO2 Inc. <a href=3D"http://www.wso2.com/" target=3D"_blank">www.wso2.co=
m</a><br>

<br><a href=3D"mailto:Email%[email protected]" target=3D"_blank">Email:lahi=
[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 . Middl=
eware<br>
<br>
</div>
</blockquote></div></div><br></div></blockquote></div><br><br clear=3D"all"=
><br>-- <br>Lahiru Gunathilake<br>Senior Software Engineer - WSO2 Inc. <a h=
ref=3D"http://www.wso2.com">www.wso2.com</a><br><br><a href=3D"mailto:Email=
%[email protected]">Email:[email protected]</a> Blog: <a href=3D"http://www.l=
ahiru.org">www.lahiru.org</a><br>
Mobile: +94716381143<br><br>Lean . Enterprise . Middleware<br><br>
</div>

--001517503ba6e3a36a049d56b509--