New es plugin : partial update

hey,guys

I just pushed a elasticsearch plugin to github,https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?
a.. first,let’s index a doucument
curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}
a.. now let’s get it
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}
a.. ok,let’s update it,update a filed(name),and add a new filed(time)
curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}
a.. let’s get the document again,and you can see,the document is already changed.
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m@medcl.net
blog:log.medcl.net

Hi guys,
I am using ES version 17.6.
When I tried the command

*curl -XPOST http://localhost:9200/index/type1/1/_update-d'{"name":"medcl?","time":"2011-1-1"}'
*

I am getting the message as

*No handler found for uri [/index/type1/1/_update] and method [POST]. *
*
*
Do I doing anything wrong.
Please help me to understand.

Thank
Ranga.

2011/9/17 medcl2000@gmail.com

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid
full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is already
    changed.

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m@medcl.net
blog:log.medcl.net

--
with regards
Ranga.....

Did you install the plugin and restart ES ?

David :wink:

Le 17 sept. 2011 à 07:16, "Ranganathan R." srrranga@gmail.com a écrit :

Hi guys,
I am using ES version 17.6.
When I tried the command

curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

I am getting the message as

No handler found for uri [/index/type1/1/_update] and method [POST].

Do I doing anything wrong.
Please help me to understand.

Thank
Ranga.

2011/9/17 medcl2000@gmail.com
hey,guys

I just pushed a elasticsearch plugin to github,https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

first,let’s index a doucument
curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}
now let’s get it
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}
ok,let’s update it,update a filed(name),and add a new filed(time)
curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}
let’s get the document again,and you can see,the document is already changed.
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m@medcl.net
blog:log.medcl.net

--
with regards
Ranga.....

Hi David,
Thanks for the reply.
I have installed the plug in but not restarted the ES. Will restart now.

On Sat, Sep 17, 2011 at 11:44 AM, David Pilato david@pilato.fr wrote:

Did you install the plugin and restart ES ?

David :wink:

Le 17 sept. 2011 à 07:16, "Ranganathan R." srrranga@gmail.com a écrit :

Hi guys,
I am using ES version 17.6.
When I tried the command

*curl -XPOST http://localhost:9200/index/type1/1/_update
http://localhost:9200/index/type1/1/_update-d'{"name":"medcl?","time":"2011-1-1"}'
*

I am getting the message as

*No handler found for uri [/index/type1/1/_update] and method [POST]. *
*
*
Do I doing anything wrong.
Please help me to understand.

Thank
Ranga.

2011/9/17 < medcl2000@gmail.commedcl2000@gmail.com>

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid
full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":" http://log.medcl.nethttp://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":" http://log.medcl.nethttp://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_updatehttp://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is already
    changed.

curl -XGET http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":" http://log.medcl.nethttp://log.medcl.net"}}


mail: m@medcl.netm@medcl.net
blog: http://log.medcl.netlog.medcl.net

--
with regards
Ranga.....

--
with regards
Ranga.....

Hi All,
I tried restarting the ES, but still getting the same error.

On Sat, Sep 17, 2011 at 11:45 AM, Ranganathan R. srrranga@gmail.com wrote:

Hi David,
Thanks for the reply.
I have installed the plug in but not restarted the ES. Will restart now.

On Sat, Sep 17, 2011 at 11:44 AM, David Pilato david@pilato.fr wrote:

Did you install the plugin and restart ES ?

David :wink:

Le 17 sept. 2011 à 07:16, "Ranganathan R." srrranga@gmail.com a écrit :

Hi guys,
I am using ES version 17.6.
When I tried the command

*curl -XPOST http://localhost:9200/index/type1/1/_update
http://localhost:9200/index/type1/1/_update-d'{"name":"medcl?","time":"2011-1-1"}'
*

I am getting the message as

*No handler found for uri [/index/type1/1/_update] and method [POST]. *
*
*
Do I doing anything wrong.
Please help me to understand.

Thank
Ranga.

2011/9/17 < medcl2000@gmail.commedcl2000@gmail.com>

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid
full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":" http://log.medcl.nethttp://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":" http://log.medcl.nethttp://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_updatehttp://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is
    already changed.

curl -XGET http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":" http://log.medcl.nethttp://log.medcl.net"}}


mail: m@medcl.netm@medcl.net
blog: http://log.medcl.netlog.medcl.net

--
with regards
Ranga.....

--
with regards
Ranga.....

--
with regards
Ranga.....

Can you see the plugin in your plugins directory ?
I'm wondering if you could have trouble downloading it, because the repo name have uppercase chars and plugin in the download section of github is in lowercase.

David :wink:

Le 17 sept. 2011 à 08:38, "Ranganathan R." srrranga@gmail.com a écrit :

Hi All,
I tried restarting the ES, but still getting the same error.

On Sat, Sep 17, 2011 at 11:45 AM, Ranganathan R. srrranga@gmail.com wrote:
Hi David,
Thanks for the reply.
I have installed the plug in but not restarted the ES. Will restart now.

On Sat, Sep 17, 2011 at 11:44 AM, David Pilato david@pilato.fr wrote:
Did you install the plugin and restart ES ?

David :wink:

Le 17 sept. 2011 à 07:16, "Ranganathan R." srrranga@gmail.com a écrit :

Hi guys,
I am using ES version 17.6.
When I tried the command

curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

I am getting the message as

No handler found for uri [/index/type1/1/_update] and method [POST].

Do I doing anything wrong.
Please help me to understand.

Thank
Ranga.

2011/9/17 medcl2000@gmail.com
hey,guys

I just pushed a elasticsearch plugin to github,https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

first,let’s index a doucument
curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}
now let’s get it
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}
ok,let’s update it,update a filed(name),and add a new filed(time)
curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}
let’s get the document again,and you can see,the document is already changed.
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m@medcl.net
blog:log.medcl.net

--
with regards
Ranga.....

--
with regards
Ranga.....

--
with regards
Ranga.....

Cool , this is a feature enhancement many of us were waiting.

Thanks
Vineeth

2011/9/17 medcl2000@gmail.com

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid
full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is already
    changed.

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m@medcl.net
blog:log.medcl.net

Hey,

Note, though a great initiative, the partial update here basically does
"get and reindex". The document will get reindexed.

-shay.banon

On Sat, Sep 17, 2011 at 11:09 AM, Vineeth Mohan
vineethmohan@algotree.comwrote:

Cool , this is a feature enhancement many of us were waiting.

Thanks
Vineeth

2011/9/17 medcl2000@gmail.com

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid
full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is already
    changed.

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m@medcl.net
blog:log.medcl.net

Hi,
I can see the plugin in plugins directory.
I did not had any trouble in downloading and installing the plugin...

On Sat, Sep 17, 2011 at 12:55 PM, David Pilato david@pilato.fr wrote:

Can you see the plugin in your plugins directory ?
I'm wondering if you could have trouble downloading it, because the repo
name have uppercase chars and plugin in the download section of github is in
lowercase.

David :wink:

Le 17 sept. 2011 à 08:38, "Ranganathan R." srrranga@gmail.com a écrit :

Hi All,
I tried restarting the ES, but still getting the same error.

On Sat, Sep 17, 2011 at 11:45 AM, Ranganathan R. < srrranga@gmail.com
srrranga@gmail.com> wrote:

Hi David,
Thanks for the reply.
I have installed the plug in but not restarted the ES. Will restart now.

On Sat, Sep 17, 2011 at 11:44 AM, David Pilato < david@pilato.fr
david@pilato.fr> wrote:

Did you install the plugin and restart ES ?

David :wink:

Le 17 sept. 2011 à 07:16, "Ranganathan R." < srrranga@gmail.com
srrranga@gmail.com> a écrit :

Hi guys,
I am using ES version 17.6.
When I tried the command

*curl -XPOST http://localhost:9200/index/type1/1/_updatehttp://localhost:9200/index/type1/1/_update
http://localhost:9200/index/type1/1/_update-d'{"name":"medcl?","time":"2011-1-1"}'
*

I am getting the message as

*No handler found for uri [/index/type1/1/_update] and method [POST]. *
*
*
Do I doing anything wrong.
Please help me to understand.

Thank
Ranga.

2011/9/17 < medcl2000@gmail.com medcl2000@gmail.com
medcl2000@gmail.com>

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a
document,avoid full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/ http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":" http://log.medcl.net http://log.medcl.nethttp://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/ http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":" http://log.medcl.net http://log.medcl.nethttp://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_update http://localhost:9200/index/type1/1/_updatehttp://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is
    already changed.

curl -XGET http://localhost:9200/index/type1/1/ http://localhost:9200/index/type1/1/http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":" http://log.medcl.net http://log.medcl.nethttp://log.medcl.net"}}


mail: m@medcl.net m@medcl.netm@medcl.net
blog: http://log.medcl.net http://log.medcl.netlog.medcl.net

--
with regards
Ranga.....

--
with regards
Ranga.....

--
with regards
Ranga.....

--
with regards
Ranga.....

hi,kimchy,
yes,that’s right,this plugin is just simply send the field changes to the es,and do a reindex operation remotely,
and it depends on that you have source enabled,and your document is not nested object.

to Ranga,
why not just download the jar,and put it to the plugin folder(make a sub-folder(like es-partial-update)),and then restart the es.
you can get it from elasticsearch-partialupdate-0.17.6.zip

--medcl

From: Shay Banon
Sent: Saturday, September 17, 2011 5:29 PM
To: elasticsearch@googlegroups.com
Subject: Re: new es plugin : partial update

Hey,

Note, though a great initiative, the partial update here basically does "get and reindex". The document will get reindexed.

-shay.banon

On Sat, Sep 17, 2011 at 11:09 AM, Vineeth Mohan vineethmohan@algotree.com wrote:

Cool , this is a feature enhancement many of us were waiting.

Thanks
Vineeth

2011/9/17 medcl2000@gmail.com

hey,guys

I just pushed a elasticsearch plugin to github,https://github.com/medcl/ElasticSearch.PartialUpdate 
the plugin that allows you to update a specify fileds of a document,avoid full reindex and  reduce some traffic costs,

here is a quick intro:
how to play with this plguin?
  a.. first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}
a.. now let’s get it
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}
a.. ok,let’s update it,update a filed(name),and add a new filed(time)
curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}
a.. let’s get the document again,and you can see,the document is already changed.
curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}

-- --
mail:m@medcl.net
blog:log.medcl.net

The "get and reindex" happens on the server instead of the client, correct?
Could be a big performance boost for some configurations if so.

james,you are right.

From: James Cook
Sent: Monday, September 19, 2011 7:15 AM
To: elasticsearch@googlegroups.com
Subject: Re: new es plugin : partial update

The "get and reindex" happens on the server instead of the client, correct? Could be a big performance boost for some configurations if so.

Hey,

I have the same issue as Ranga does. I installed it properly on ( now)
0.17.7 and restarted. The plugins seems to be active (log: [...] loaded
[mapper-attachments, analysis-icu], sites [ElasticSearch.PartialUpdate]
[...]) but the method remains unknown.

What am I doing wrong? Thx in Advance

1 question here.
Is this "get and reindex" operation atomic.
That will will dirty reads happen ??
While data is read and written back , is it guaranteed that no writes happen
in the document ?

Thanks
Vineeth

On Tue, Oct 4, 2011 at 4:01 AM, Frifri henning.frieder@googlemail.comwrote:

Hey,

I have the same issue as Ranga does. I installed it properly on ( now)
0.17.7 and restarted. The plugins seems to be active (log: [...] loaded
[mapper-attachments, analysis-icu], sites [ElasticSearch.PartialUpdate]
[...]) but the method remains unknown.

What am I doing wrong? Thx in Advance

These are two independent operations but you can use versioning feature to
learn if the document has been modified meantime. Do not know if this plugin
is using it though.

Lukas

On Saturday, October 15, 2011, Vineeth Mohan vineethmohan@algotree.com
wrote:

1 question here.
Is this "get and reindex" operation atomic.
That will will dirty reads happen ??
While data is read and written back , is it guaranteed that no writes
happen in the document ?

Thanks
Vineeth

On Tue, Oct 4, 2011 at 4:01 AM, Frifri henning.frieder@googlemail.com
wrote:

Hey,

I have the same issue as Ranga does. I installed it properly on ( now)
0.17.7 and restarted. The plugins seems to be active (log: [...] loaded
[mapper-attachments, analysis-icu], sites [ElasticSearch.PartialUpdate]
[...]) but the method remains unknown.

What am I doing wrong? Thx in Advance

Hey Guys,

I am using spring data elasticsearch in my project and I am facing the
following problem. Please help.

Code:

IndexRequest indexRequest = new IndexRequest();

        indexRequest.source("viewer", *true*);

       

        UpdateQuery updateQuery = *new*UpdateQueryBuilder().withId(documentID).

withIndexRequest(indexRequest).build();

        updateQuery.setIndexName(SearchConstants.*INDEX_NAME*);

        updateQuery.setType(SearchConstants.*INDEX_TYPE_BOOK*+"_"

+book.getBookmetadata().getLanguage());

        //logger.debug("Indexing book " + documentID + ":" + 

book.getBookmetadata().getTitle());

        elasticsearchTemplate.update(updateQuery);

Error

org.elasticsearch.common.util.concurrent.UncategorizedExecutionException:
Failed execution

   at 

org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(
AdapterActionFuture.java:88)

   at org.elasticsearch.action.support.AdapterActionFuture.actionGet(*

AdapterActionFuture.java:49*)

   at 

org.springframework.data.elasticsearch.core.ElasticsearchTemplate.update(*
ElasticsearchTemplate.java:226*)

   at 

com.pearson.nexttext.plugins.service.elasticsearch.searchservices.impl.BookIndexingServiceImpl.reIndexBook(
BookIndexingServiceImpl.java:126)

   at 

com.pearson.nexttext.service.api.service.impl.BookIndexServiceImpl.reIndexBook(
BookIndexServiceImpl.java:25)

   at 

com.pearson.nexttext.service.api.controller.IndexController.reIndexBook(*
IndexController.java:58*)

   at sun.reflect.NativeMethodAccessorImpl.invoke0(*Native Method*)

   at sun.reflect.NativeMethodAccessorImpl.invoke(*

NativeMethodAccessorImpl.java:39*)

   at sun.reflect.DelegatingMethodAccessorImpl.invoke(*

DelegatingMethodAccessorImpl.java:25*)

   at java.lang.reflect.Method.invoke(*Method.java:597*)

   at 

org.springframework.web.method.support.InvocableHandlerMethod.invoke(*
InvocableHandlerMethod.java:219*)

   at 

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(
InvocableHandlerMethod.java:132)

   at 

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(
ServletInvocableHandlerMethod.java:104)

   at 

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(
RequestMappingHandlerAdapter.java:745)

   at 

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(
RequestMappingHandlerAdapter.java:686)

   at 

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(
AbstractHandlerMethodAdapter.java:80)

   at org.springframework.web.servlet.DispatcherServlet.doDispatch(*

DispatcherServlet.java:925*)

   at org.springframework.web.servlet.DispatcherServlet.doService(*

DispatcherServlet.java:856*)

   at org.springframework.web.servlet.FrameworkServlet.processRequest(*

FrameworkServlet.java:936*)

   at org.springframework.web.servlet.FrameworkServlet.doPost(*

FrameworkServlet.java:838*)

   at javax.servlet.http.HttpServlet.service(*HttpServlet.java:727*)

   at org.springframework.web.servlet.FrameworkServlet.service(*

FrameworkServlet.java:812*)

   at javax.servlet.http.HttpServlet.service(*HttpServlet.java:820*)

   at org.mortbay.jetty.servlet.ServletHolder.handle(*

ServletHolder.java:487*)

   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(*

ServletHandler.java:1093*)

   at 

org.springframework.security.web.FilterChainProxy.doFilterInternal(*
FilterChainProxy.java:186*)

   at org.springframework.security.web.FilterChainProxy.doFilter(*

FilterChainProxy.java:160*)

   at 

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(*
DelegatingFilterProxy.java:346*)

   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(*

DelegatingFilterProxy.java:259*)

   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(*

ServletHandler.java:1084*)

   at org.mortbay.jetty.servlet.ServletHandler.handle(*

ServletHandler.java:360*)

   at org.mortbay.jetty.security.SecurityHandler.handle(*

SecurityHandler.java:216*)

   at org.mortbay.jetty.servlet.SessionHandler.handle(*

SessionHandler.java:181*)

   at org.mortbay.jetty.handler.ContextHandler.handle(*

ContextHandler.java:726*)

   at org.mortbay.jetty.webapp.WebAppContext.handle(*

WebAppContext.java:405*)

   at org.mortbay.jetty.handler.ContextHandlerCollection.handle(*

ContextHandlerCollection.java:206*)

   at org.mortbay.jetty.handler.HandlerCollection.handle(*

HandlerCollection.java:114*)

   at org.mortbay.jetty.handler.HandlerWrapper.handle(*

HandlerWrapper.java:152*)

   at org.mortbay.jetty.Server.handle(*Server.java:324*)

   at org.mortbay.jetty.HttpConnection.handleRequest(*

HttpConnection.java:505*)

   at org.mortbay.jetty.HttpConnection$RequestHandler.content(*

HttpConnection.java:843*)

   at org.mortbay.jetty.HttpParser.parseNext(*HttpParser.java:648*)

   at org.mortbay.jetty.HttpParser.parseAvailable(*HttpParser.java:211*)

   at org.mortbay.jetty.HttpConnection.handle(*HttpConnection.java:380*)

   at org.mortbay.io.nio.SelectChannelEndPoint.run(*

SelectChannelEndPoint.java:395*)

   at org.mortbay.thread.QueuedThreadPool$PoolThread.run(*

QueuedThreadPool.java:488*)

Caused by: java.lang.IndexOutOfBoundsException: Readable byte limit
exceeded: 175

   at 

org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(*
AbstractChannelBuffer.java:236*)

   at 

org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(*
ChannelBufferStreamInput.java:132*)

   at org.elasticsearch.common.io.stream.AdapterStreamInput.readByte(*

AdapterStreamInput.java:35*)

   at org.elasticsearch.common.io.stream.StreamInput.readBoolean(*

StreamInput.java:252*)

   at org.elasticsearch.action.update.UpdateRequest.readFrom(*

UpdateRequest.java:566*)

   at 

org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(*
MessageChannelHandler.java:204*)

   at 

org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(*
MessageChannelHandler.java:108*)

   at 

org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(
SimpleChannelUpstreamHandler.java:70)

   at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(*
DefaultChannelPipeline.java:564*)

   at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(
DefaultChannelPipeline.java:791)

   at 

org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(*
Channels.java:296*)

   at 

org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(
FrameDecoder.java:462)

   at 

org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(*
FrameDecoder.java:443*)

   at 

org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(
FrameDecoder.java:303)

   at 

org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(
SimpleChannelUpstreamHandler.java:70)

   at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(*
DefaultChannelPipeline.java:564*)

   at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(
DefaultChannelPipeline.java:791)

   at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(

OpenChannelsHandler.java:74)

   at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(*
DefaultChannelPipeline.java:564*)

   at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(*
DefaultChannelPipeline.java:559*)

   at 

org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(*
Channels.java:268*)

   at 

org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(*
Channels.java:255*)

   at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(*

NioWorker.java:88*)

   at 

org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(
AbstractNioWorker.java:109)

   at 

org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(*
AbstractNioSelector.java:312*)

   at 

org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(*
AbstractNioWorker.java:90*)

   at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(*

NioWorker.java:178*)

   at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(*

ThreadRenamingRunnable.java:108*)

   at 

org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(*
DeadLockProofWorker.java:42*)

   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(*

ThreadPoolExecutor.java:886*)

   at java.util.concurrent.ThreadPoolExecutor$Worker.run(*

ThreadPoolExecutor.java:908*)

   at java.lang.Thread.run(*Thread.java:619*)

Can you please point what I am doing wrong here. I have spent a lot of time
on this but I am not able to resolve this.

On Saturday, September 17, 2011 9:59:59 AM UTC+5:30, Medcl wrote:

hey,guys

I just pushed a elasticsearch plugin to github,
https://github.com/medcl/ElasticSearch.PartialUpdate
the plugin that allows you to update a specify fileds of a document,avoid
full reindex and reduce some traffic costs,

here is a quick intro:
how to play with this plguin?

  • first,let’s index a doucument

curl -XDELETE http://localhost:9200/index/type1/1/
curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"medcl","blog":"http://log.medcl.net"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":1}

  • now let’s get it

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":1, "_source" : {"name":"medcl","blog":"http://log.medcl.net"}}

  • ok,let’s update it,update a filed(name),and add a new filed(time)

curl -XPOST http://localhost:9200/index/type1/1/_update -d'{"name":"medcl?","time":"2011-1-1"}'

{"ok":true,"_index":"index","_type":"type1","_id":"1","_version":2}

  • let’s get the document again,and you can see,the document is already
    changed.

curl -XGET http://localhost:9200/index/type1/1/

{"_index":"index","_type":"type1","_id":"1","_version":2, "_source" : {"time":"2011-1-1","name":"medcl?","blog":"http://log.medcl.net"}}


mail:m...@medcl.net <javascript:>
blog:log.medcl.net

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.