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:lah...@wso2.com Blog: www.lahiru.org
> Mobile: +94716381143
> 
> Lean . Enterprise . Middleware
> 

Reply via email to