You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Lahiru Gunathilake <la...@wso2.com> on 2011/02/25 17:09:11 UTC

Can we delete documents based on an Id

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
?

Regards
Lahiru

-- 
Lahiru Gunathilake
Senior Software Engineer - WSO2 Inc. www.wso2.com

Email:lahiru@wso2.com Blog: www.lahiru.org
Mobile: +94716381143

Lean . Enterprise . Middleware

Re: unsuscribe

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Just a reminder - if you want to unsubscribe, you should read and follow instructions at:
  http://xml.apache.org/xindice/mail.html


Vadim


On Feb 25, 2011, at 11:11 AM, Honglin Ye wrote:

> 


On Feb 25, 2011, at 1:23 PM, Juergen Bartsch wrote:

>  


unsuscribe

Posted by Honglin Ye <hy...@aoc.nrao.edu>.


Re: Can we delete documents based on an Id

Posted by Lahiru Gunathilake <la...@wso2.com>.
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
<ns...@gmail.com>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 <la...@wso2.com>
> 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 <
> nshilenkova@gmail.com>
> > 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:lahiru@wso2.com Blog: www.lahiru.org
> >> Mobile: +94716381143
> >>
> >> Lean . Enterprise . Middleware
> >>
> >>
> >
> >
> >
> > --
> > Lahiru Gunathilake
> > Senior Software Engineer - WSO2 Inc. www.wso2.com
> >
> > Email:lahiru@wso2.com Blog: www.lahiru.org
> > Mobile: +94716381143
> >
> > Lean . Enterprise . Middleware
> >
> >
>



-- 
Lahiru Gunathilake
Senior Software Engineer - WSO2 Inc. www.wso2.com

Email:lahiru@wso2.com Blog: www.lahiru.org
Mobile: +94716381143

Lean . Enterprise . Middleware

Re: Can we delete documents based on an Id

Posted by Natalia Shilenkova <ns...@gmail.com>.
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 <la...@wso2.com> 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 <ns...@gmail.com>
> 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:lahiru@wso2.com Blog: www.lahiru.org
>> Mobile: +94716381143
>>
>> Lean . Enterprise . Middleware
>>
>>
>
>
>
> --
> Lahiru Gunathilake
> Senior Software Engineer - WSO2 Inc. www.wso2.com
>
> Email:lahiru@wso2.com Blog: www.lahiru.org
> Mobile: +94716381143
>
> Lean . Enterprise . Middleware
>
>

Re: Can we delete documents based on an Id

Posted by Lahiru Gunathilake <la...@wso2.com>.
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
<ns...@gmail.com>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:lahiru@wso2.com Blog: www.lahiru.org
> Mobile: +94716381143
>
> Lean . Enterprise . Middleware
>
>
>


-- 
Lahiru Gunathilake
Senior Software Engineer - WSO2 Inc. www.wso2.com

Email:lahiru@wso2.com Blog: www.lahiru.org
Mobile: +94716381143

Lean . Enterprise . Middleware

Re: Can we delete documents based on an Id

Posted by Natalia Shilenkova <ns...@gmail.com>.
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:lahiru@wso2.com Blog: www.lahiru.org
> Mobile: +94716381143
> 
> Lean . Enterprise . Middleware
>