Re: Can we delete documents based on an Id

Natalia Shilenkova <[email protected]> Mon, 28 Feb 2011 09:23:15 -0500
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
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 =A0you 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=A0referring=A0as key ?
> Regards
> Lahiru
>
> On Mon, Feb 28, 2011 at 5:35 PM, Natalia Shilenkova <[email protected]=
m>
> 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 requiremen=
t
>> is like this.
>> I am pumping in the incoming xml content to xindice while storing them i=
n
>> 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 unneces=
sary
>> 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 li=
st
>> 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 =3D 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
>
>