Add/delete in update api

Hi there,
I need to know if we can add new attributes and delete the old
ones in the document?? or this api is just to edit the existing fields??? I
tried this api to add new one, but not getting the results...so please tell
me if i am doing something wrong or its not the part of the functionality...

Thanks

Just send the new version of your document.

David

Le 28 mai 2012 à 09:35, Narinder Kaur narinder.kaur@izap.in a écrit :

Hi there,
I need to know if we can add new attributes and delete the old ones in the document?? or this api is just to edit the existing fields??? I tried this api to add new one, but not getting the results...so please tell me if i am doing something wrong or its not the part of the functionality...

Thanks

I am sending the new version of the document. but still its just not there
in the document.

On Monday, 28 May 2012 13:11:08 UTC+5:30, David Pilato wrote:

Just send the new version of your document.

David

Le 28 mai 2012 à 09:35, Narinder Kaur narinder.kaur@izap.in a écrit :

Hi there,
I need to know if we can add new attributes and delete the old
ones in the document?? or this api is just to edit the existing fields??? I
tried this api to add new one, but not getting the results...so please tell
me if i am doing something wrong or its not the part of the
functionality...

Thanks

Could you gist your issue ?

Le 28 mai 2012 à 10:05, Narinder Kaur narinder.kaur@izap.in a écrit :

I am sending the new version of the document. but still its just not there in the document.

On Monday, 28 May 2012 13:11:08 UTC+5:30, David Pilato wrote:
Just send the new version of your document.

David

Le 28 mai 2012 à 09:35, Narinder Kaur narinder.kaur@izap.in a écrit :

Hi there,
I need to know if we can add new attributes and delete the old ones in the document?? or this api is just to edit the existing fields??? I tried this api to add new one, but not getting the results...so please tell me if i am doing something wrong or its not the part of the functionality...

Thanks

You can use the update API to add new field and delete existing
fields. Basically you have your doc to update in ctx._source and you
can add new fields and delete fields with the supported language of
your choice. For example in maven ctx._source.foobar = 4 will add a
new foobar field. Hope this help

On Mon, May 28, 2012 at 9:35 AM, Narinder Kaur narinder.kaur@izap.in wrote:

Hi there,
I need to know if we can add new attributes and delete the old
ones in the document?? or this api is just to edit the existing fields??? I
tried this api to add new one, but not getting the results...so please tell
me if i am doing something wrong or its not the part of the functionality...

Thanks

--
Benjamin DEVEZE

"maven" -> "mvel"

On Mon, May 28, 2012 at 6:08 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

You can use the update API to add new field and delete existing
fields. Basically you have your doc to update in ctx._source and you
can add new fields and delete fields with the supported language of
your choice. For example in maven ctx._source.foobar = 4 will add a
new foobar field. Hope this help

On Mon, May 28, 2012 at 9:35 AM, Narinder Kaur narinder.kaur@izap.in wrote:

Hi there,
I need to know if we can add new attributes and delete the old
ones in the document?? or this api is just to edit the existing fields??? I
tried this api to add new one, but not getting the results...so please tell
me if i am doing something wrong or its not the part of the functionality...

Thanks

--
Benjamin DEVEZE

--
Benjamin DEVEZE

To be complete you can use the following syntax to delete an existing field:

"script" : "ctx._source.remove("foobar")"

On Mon, May 28, 2012 at 6:09 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

"maven" -> "mvel"

On Mon, May 28, 2012 at 6:08 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

You can use the update API to add new field and delete existing
fields. Basically you have your doc to update in ctx._source and you
can add new fields and delete fields with the supported language of
your choice. For example in maven ctx._source.foobar = 4 will add a
new foobar field. Hope this help

On Mon, May 28, 2012 at 9:35 AM, Narinder Kaur narinder.kaur@izap.in wrote:

Hi there,
I need to know if we can add new attributes and delete the old
ones in the document?? or this api is just to edit the existing fields??? I
tried this api to add new one, but not getting the results...so please tell
me if i am doing something wrong or its not the part of the functionality...

Thanks

--
Benjamin DEVEZE

--
Benjamin DEVEZE

--
Benjamin DEVEZE

thanks so much for the help...

On Monday, 28 May 2012 22:47:03 UTC+5:30, Benjamin Devèze wrote:

To be complete you can use the following syntax to delete an existing
field:

"script" : "ctx._source.remove("foobar")"

On Mon, May 28, 2012 at 6:09 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

"maven" -> "mvel"

On Mon, May 28, 2012 at 6:08 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

You can use the update API to add new field and delete existing
fields. Basically you have your doc to update in ctx._source and you
can add new fields and delete fields with the supported language of
your choice. For example in maven ctx._source.foobar = 4 will add a
new foobar field. Hope this help

On Mon, May 28, 2012 at 9:35 AM, Narinder Kaur narinder.kaur@izap.in
wrote:

Hi there,
I need to know if we can add new attributes and delete the
old
ones in the document?? or this api is just to edit the existing
fields??? I
tried this api to add new one, but not getting the results...so please
tell
me if i am doing something wrong or its not the part of the
functionality...

Thanks

--
Benjamin DEVEZE

--
Benjamin DEVEZE

--
Benjamin DEVEZE

I need to add an array structure to the document through update api, tried
to add the array to the document in the same way, but dint added the array
field to the document. and it genereted the error "*
set_whatsnew_on_next_login*". can you please tell me how to add this too???

Thanks

On Monday, 28 May 2012 22:47:03 UTC+5:30, Benjamin Devèze wrote:

To be complete you can use the following syntax to delete an existing
field:

"script" : "ctx._source.remove("foobar")"

On Mon, May 28, 2012 at 6:09 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

"maven" -> "mvel"

On Mon, May 28, 2012 at 6:08 PM, Benjamin Devèze
benjamin.deveze@gmail.com wrote:

You can use the update API to add new field and delete existing
fields. Basically you have your doc to update in ctx._source and you
can add new fields and delete fields with the supported language of
your choice. For example in maven ctx._source.foobar = 4 will add a
new foobar field. Hope this help

On Mon, May 28, 2012 at 9:35 AM, Narinder Kaur narinder.kaur@izap.in
wrote:

Hi there,
I need to know if we can add new attributes and delete the
old
ones in the document?? or this api is just to edit the existing
fields??? I
tried this api to add new one, but not getting the results...so please
tell
me if i am doing something wrong or its not the part of the
functionality...

Thanks

--
Benjamin DEVEZE

--
Benjamin DEVEZE

--
Benjamin DEVEZE