Update API Problem

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a new tag
    named "reported".

Running curl through php:
*
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-type/vG2dLak5TXSzW1jKlitOGg/_update
*
POST data is: array("script" => "ctx._source.tags += tag", "params" =>
array("tag" => "reported"))* - this is encoded to json, looks same as the
documentation,*

I'm getting this
error {"error":"ElasticSearchIllegalArgumentException[failed to execute
script]; nested: PropertyAccessException[[Error: could not access: tags; in
class: java.util.LinkedHashMap]\n[Near : {... ctx._source.tags+tag ....}]\n
^\n[Line: 1, Column: 1]]; ","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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.

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a new
    tag named "reported".

Running curl through php:
*
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-type/vG2dLak5TXSzW1jKlitOGg/_update
*
POST data is: array("script" => "ctx._source.tags += tag", "params" =>
array("tag" => "reported"))* - this is encoded to json, looks same as the
documentation,*

I'm getting this
error {"error":"ElasticSearchIllegalArgumentException[failed to execute
script]; nested: PropertyAccessException[[Error: could not access: tags; in
class: java.util.LinkedHashMap]\n[Near : {... ctx._source.tags+tag ....}]\n
^\n[Line: 1, Column: 1]]; ","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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.

Hey,

can you provide the real JSON used in the request - just to make sure there
are no strange errors leading to this exception? Also can you check the
logs for a more verbose logging?

--Alex

On Tue, Apr 2, 2013 at 8:24 AM, okhafi@gmail.com wrote:

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a new
    tag named "reported".

Running curl through php:
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-
type/vG2dLak5TXSzW1jKlitOGg/_update

POST data is: array("script" => "ctx._source.tags += tag", "params" =>
array("tag" => "reported"))* - this is encoded to json, looks same as
the documentation,*

I'm getting this error {"error":"ElasticSearchIllegalArgumentException[failed
to execute script]; nested: PropertyAccessException[[**Error: could not
access: tags; in class: java.util.LinkedHashMap]\n[**Near : {...
ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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.

--
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.

curl -XPOST
'localhost:9200/logstash-2013.03.28/xxxxx_log-type/qWtE27BWQuCsjBWUxoCxdg/_update'
-d '{
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "reported"
}
}'

Execption:
{"error":"ElasticSearchIllegalArgumentException[failed to execute script];
nested: PropertyAccessException[[Error: could not access: tags; in class:
java.util.LinkedHashMap]\n[Near : {... ctx._source.tags+tag ....}]\n
^\n[Line: 1, Column: 1]]; ","status":400}

On Tuesday, April 2, 2013 9:29:55 AM UTC+3, Alexander Reelsen wrote:

Hey,

can you provide the real JSON used in the request - just to make sure
there are no strange errors leading to this exception? Also can you check
the logs for a more verbose logging?

--Alex

On Tue, Apr 2, 2013 at 8:24 AM, <okh...@gmail.com <javascript:>> wrote:

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and
kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a new
    tag named "reported".

Running curl through php:
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-
type/vG2dLak5TXSzW1jKlitOGg/_update

POST data is: array("script" => "ctx._source.tags += tag", "params" =>
array("tag" => "reported"))* - this is encoded to json, looks same as
the documentation,*

I'm getting this error {"error":"ElasticSearchIllegalArgumentException[failed
to execute script]; nested: PropertyAccessException[[**Error: could not
access: tags; in class: java.util.LinkedHashMap]\n[**Near : {...
ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.

Hey,

curl -X PUT localhost:9200/foo/bar/1 -d '{ "tags": ["a","b"] }'
curl -X POST localhost:9200/foo/bar/1/_update -d '{ "script" :
"ctx._source.tags += tag", "params" : { "tag" : "reported" } }'
curl localhost:9200/foo/bar/1
{"_index":"foo","_type":"bar","_id":"1","_version":4,"exists":true,
"_source" : {"tags":["a","b","reported"]}}

looks ok, with a local test.. can you show the source of the document you
are trying to update?

--Alex

On Tue, Apr 2, 2013 at 12:49 PM, okhafi@gmail.com wrote:

curl -XPOST
'localhost:9200/logstash-2013.03.28/xxxxx_log-type/qWtE27BWQuCsjBWUxoCxdg/_update'
-d '{
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "reported"
}
}'

Execption:
{"error":"ElasticSearchIllegalArgumentException[failed to execute script];
nested: PropertyAccessException[[Error: could not access: tags; in class:
java.util.LinkedHashMap]\n[Near : {... ctx._source.tags+tag ....}]\n
^\n[Line: 1, Column: 1]]; ","status":400}

On Tuesday, April 2, 2013 9:29:55 AM UTC+3, Alexander Reelsen wrote:

Hey,

can you provide the real JSON used in the request - just to make sure
there are no strange errors leading to this exception? Also can you check
the logs for a more verbose logging?

--Alex

On Tue, Apr 2, 2013 at 8:24 AM, okh...@gmail.com wrote:

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and
kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a new
    tag named "reported".

Running curl through php:
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-type/
vG2dLak5TXSzW1jKlitOGg/_update

POST data is: array("script" => "ctx._source.tags += tag", "params" =>
array("tag" => "reported"))* - this is encoded to json, looks same as
the documentation,*

I'm getting this error {"error":"ElasticSearchIllegalArgumentEx**ception[failed
to execute script]; nested: PropertyAccessException[[Error: could
not access: tags; in class: java.util.LinkedHashMap]\n[Near : {...
ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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.

--
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.

Hey,

{"_index":"logstash-2013.03.28","_type":"xxxxx_log-type","_id":"qWtE27BWQuCsjBWUxoCxdg","_version":1,"exists":true,
"_source" :

The source is an exception and has some \n in it...

Thanks,
Or

On Tuesday, April 2, 2013 1:54:00 PM UTC+3, Alexander Reelsen wrote:

Hey,

curl -X PUT localhost:9200/foo/bar/1 -d '{ "tags": ["a","b"] }'
curl -X POST localhost:9200/foo/bar/1/_update -d '{ "script" :
"ctx._source.tags += tag", "params" : { "tag" : "reported" } }'
curl localhost:9200/foo/bar/1
{"_index":"foo","_type":"bar","_id":"1","_version":4,"exists":true,
"_source" : {"tags":["a","b","reported"]}}

looks ok, with a local test.. can you show the source of the document you
are trying to update?

--Alex

On Tue, Apr 2, 2013 at 12:49 PM, <okh...@gmail.com <javascript:>> wrote:

curl -XPOST
'localhost:9200/logstash-2013.03.28/xxxxx_log-type/qWtE27BWQuCsjBWUxoCxdg/_update'
-d '{
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "reported"
}
}'

Execption:
{"error":"ElasticSearchIllegalArgumentException[failed to execute
script]; nested: PropertyAccessException[[Error: could not access: tags; in
class: java.util.LinkedHashMap]\n[Near : {... ctx._source.tags+tag ....}]\n
^\n[Line: 1, Column: 1]]; ","status":400}

On Tuesday, April 2, 2013 9:29:55 AM UTC+3, Alexander Reelsen wrote:

Hey,

can you provide the real JSON used in the request - just to make sure
there are no strange errors leading to this exception? Also can you check
the logs for a more verbose logging?

--Alex

On Tue, Apr 2, 2013 at 8:24 AM, okh...@gmail.com wrote:

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and
kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a
    new tag named "reported".

Running curl through php:
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-type/
vG2dLak5TXSzW1jKlitOGg/_update

POST data is: array("script" => "ctx._source.tags += tag", "params" =>
array("tag" => "reported"))* - this is encoded to json, looks same as
the documentation,*

I'm getting this error {"error":"ElasticSearchIllegalArgumentEx**ception[failed
to execute script]; nested: PropertyAccessException[[Error: could
not access: tags; in class: java.util.LinkedHashMap]\n[Near :
{... ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.

Hey,
For now I just added a new field instead of tag.
Let me know if you need any information from me to resolve it.
Or

On Tuesday, April 2, 2013 2:55:00 PM UTC+3, okh...@gmail.com wrote:

Hey,

{"_index":"logstash-2013.03.28","_type":"xxxxx_log-type","_id":"qWtE27BWQuCsjBWUxoCxdg","_version":1,"exists":true,
"_source" :

The source is an exception and has some \n in it...

Thanks,
Or

On Tuesday, April 2, 2013 1:54:00 PM UTC+3, Alexander Reelsen wrote:

Hey,

curl -X PUT localhost:9200/foo/bar/1 -d '{ "tags": ["a","b"] }'
curl -X POST localhost:9200/foo/bar/1/_update -d '{ "script" :
"ctx._source.tags += tag", "params" : { "tag" : "reported" } }'
curl localhost:9200/foo/bar/1
{"_index":"foo","_type":"bar","_id":"1","_version":4,"exists":true,
"_source" : {"tags":["a","b","reported"]}}

looks ok, with a local test.. can you show the source of the document you
are trying to update?

--Alex

On Tue, Apr 2, 2013 at 12:49 PM, okh...@gmail.com wrote:

curl -XPOST
'localhost:9200/logstash-2013.03.28/xxxxx_log-type/qWtE27BWQuCsjBWUxoCxdg/_update'
-d '{
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "reported"
}
}'

Execption:
{"error":"ElasticSearchIllegalArgumentException[failed to execute
script]; nested: PropertyAccessException[[Error: could not access: tags; in
class: java.util.LinkedHashMap]\n[Near : {... ctx._source.tags+tag ....}]\n
^\n[Line: 1, Column: 1]]; ","status":400}

On Tuesday, April 2, 2013 9:29:55 AM UTC+3, Alexander Reelsen wrote:

Hey,

can you provide the real JSON used in the request - just to make sure
there are no strange errors leading to this exception? Also can you check
the logs for a more verbose logging?

--Alex

On Tue, Apr 2, 2013 at 8:24 AM, okh...@gmail.com wrote:

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and
kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a
    new tag named "reported".

Running curl through php:
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-type/
vG2dLak5TXSzW1jKlitOGg/_update

POST data is: array("script" => "ctx._source.tags += tag", "params"
=> array("tag" => "reported"))* - this is encoded to json, looks
same as the documentation,*

I'm getting this error {"error":"ElasticSearchIllegalArgumentEx**ception[failed
to execute script]; nested: PropertyAccessException[[Error:
could not access: tags; in class: java.util.LinkedHashMap]\n[Near
: {... ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.

Hey,

can you put everything in a gist, so we get some more background information

a) the document (the result of a GET operation)
b) your index mapping
c) Your update query

include all exceptions and logs as well please...

--Alex

On Wed, Apr 3, 2013 at 2:57 PM, okhafi@gmail.com wrote:

Hey,
For now I just added a new field instead of tag.
Let me know if you need any information from me to resolve it.
Or

On Tuesday, April 2, 2013 2:55:00 PM UTC+3, okh...@gmail.com wrote:

Hey,

{"_index":"logstash-2013.03.28","_type":"xxxxx_log-type","
_id":"qWtE27BWQuCsjBWUxoCxdg",**"_version":1,"exists":true, "_source" :

The source is an exception and has some \n in it...

Thanks,
Or

On Tuesday, April 2, 2013 1:54:00 PM UTC+3, Alexander Reelsen wrote:

Hey,

curl -X PUT localhost:9200/foo/bar/1 -d '{ "tags": ["a","b"] }'
curl -X POST localhost:9200/foo/bar/1/_update -d '{ "script" :
"ctx._source.tags += tag", "params" : { "tag" : "reported" } }'
curl localhost:9200/foo/bar/1
{"_index":"foo","_type":"bar",
"_id":"1","_version":4,"**exists":true,
"_source" : {"tags":["a","b","reported"]}}

looks ok, with a local test.. can you show the source of the document
you are trying to update?

--Alex

On Tue, Apr 2, 2013 at 12:49 PM, okh...@gmail.com wrote:

curl -XPOST 'localhost:9200/logstash-2013.03.28/xxxxx_log-type/
qWtE27BWQuCsjBWUxoCxdg/_**update' -d '{
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "reported"
}
}'

Execption:
{"error":"ElasticSearchIllegalArgumentException[failed to execute
script]; nested: PropertyAccessException[[**Error: could not access:
tags; in class: java.util.LinkedHashMap]\n[**Near : {...
ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

On Tuesday, April 2, 2013 9:29:55 AM UTC+3, Alexander Reelsen wrote:

Hey,

can you provide the real JSON used in the request - just to make sure
there are no strange errors leading to this exception? Also can you check
the logs for a more verbose logging?

--Alex

On Tue, Apr 2, 2013 at 8:24 AM, okh...@gmail.com wrote:

Should I open a bug?

On Saturday, March 30, 2013 4:58:05 PM UTC+3, okh...@gmail.com wrote:

Hello,
I'm new to elasticsearch. testing logstash,redis,elasticsearch and
kibana.
Version - elasticsearch-0.20.5.

For now, I'm doing this operations:

  1. I'm searching specific messages with elastic api.
  2. Sending email with the results.
  3. Taking index,id,type and trying to update the document and add a
    new tag named "reported".

Running curl through php:
http://xxx.xxx.xxx:9200/logstash-2013.03.27/xxx_log-type/vG2
dLak5TXSzW1jKlitOGg/_update

POST data is: array("script" => "ctx._source.tags += tag", "params"
=> array("tag" => "reported"))* - this is encoded to json, looks
same as the documentation,*

I'm getting this error {"error":"ElasticSearchI**
llegalArgumentEx**ception[failed to execute script]; nested:
PropertyAccessException[[Error**: could not access: tags; in
class: java.util.LinkedHashMap]\n[**Nea****r : {...
ctx._source.tags+tag ....}]\n ^\n[Line: 1, Column: 1]];
","status":400}

I'm probably missing something, any ideas?
Thanks in advance,
Or

--
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 elasticsearc...@**googlegroups.**com.

For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.**com.
For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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.

--
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.