Jelle_Smet
(Jelle Smet)
September 27, 2012, 9:45am
1
Hi list,
My goal is to update an array which name starts with an @ sign.
For this I use the _update API by executing an mvel script. It seems to
work fine on elements which have a regular name.
I'm running version 0.19.9
See following output:
curl -XGET 'http://xxx:9200/_cluster/health?pretty=true '
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 85,
"active_shards" : 85,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 85
}
This works:
curl -XPUT xxx:9200/test/test/1 -d '{"counter" : 1, "tags" : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/1/_update' -d '{"script" : "ctx._source.tags += tag","params": {"tag":"fubar2"}}'
This does not work:
curl -XPUT xxx:9200/test/test/2 -d '{"counter" : 1, "@tags " : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/2/_update' -d '{"script" : "ctx._source.@tags += tag","params": {"tag":"fubar2"}}'
{"error":"ElasticSearchIllegalArgumentException[failed to execute script]; nested: ArrayIndexOutOfBoundsException[0]; ","status":400}
--
Jelle_Smet
(Jelle Smet)
September 27, 2012, 10:15am
2
Submitted as bugreport:
I'm running version 0.19.9
curl -XGET 'http://xxx:9200/_cluster/health?pretty=true'
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 85,
"active_shards" : 85,
"relocating_shards" :...
--
Hi Jelle,
I'm having the same issue. Were you able to find a solution or workaround
for this?
Thanks,
Clive
On Thursday, September 27, 2012 5:45:46 AM UTC-4, Jelle Smet wrote:
Hi list,
My goal is to update an array which name starts with an @ sign.
For this I use the _update API by executing an mvel script. It seems to
work fine on elements which have a regular name.
I'm running version 0.19.9
See following output:
curl -XGET 'http://xxx:9200/_cluster/health?pretty=true '
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 85,
"active_shards" : 85,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 85
}
This works:
curl -XPUT xxx:9200/test/test/1 -d '{"counter" : 1, "tags" : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/1/_update' -d '{"script" : "ctx._source.tags += tag","params": {"tag":"fubar2"}}'
This does not work:
curl -XPUT xxx:9200/test/test/2 -d '{"counter" : 1, "@tags " : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/2/_update' -d '{"script" : "ctx._source.@tags += tag","params": {"tag":"fubar2"}}'
{"error":"ElasticSearchIllegalArgumentException[failed to execute script]; nested: ArrayIndexOutOfBoundsException[0]; ","status":400}
--
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 .
See
opened 08:48AM - 04 Apr 13 UTC
closed 12:42PM - 05 Apr 13 UTC
elasticsearch-0.20.5
---
curl localhost:9200/logstash-2013.03.28/xxxxx_log-typ… e/qWtE27BWQuCsjBWUxoCxdg
============================>
{"_index":"logstash-2013.03.28","_type":"xxxxx_log-type","_id":"qWtE27BWQuCsjBWUxoCxdg","_version":2,"exists":true, "_source" : {"@source":"file://xxxxx.xxxx.xxxx/opt/xxxx/xxxx/logs/xxxx.log","@tags":["multiline","grepped"],"@fields":{"timestamp":["2013-03-28 04:40:00.034"],"thread":["xxxxxxx_xxxxxxx-9"],"logseverity":["ERROR"],"class_name":["xxxxx.xxxxx.xxxxx.xxxxxxx.xxxxxx.xxxxxxxxx"],"message":["Error xxxxxx xxx xxxxx xxxxxxxx 'xxxxxx.xxxxxxx.xxxx.xxxxx.xxxxxxx.xxxxx@xxxxxxx': xxxxx xxxxxxx xxxxxxxx xxxxx."]},"@timestamp":"2013-03-28T11:40:01.003Z","@source_host":"xxxx.xxxxx.xxxx","@source_path":"/opt/xxxxxxx/xxxx/xxxx/xxxxxxxx.log","@message":"2013-03-28 04:40:00.034 [xxxxxxxxxxx_xxxxxxxx-9] ERROR xxxx.xxxx.xxxx.xxxx.xxx - Error xxxxx xxx xxxxx xxxxx 'xxxxxx.xxxxxxx.xxxx.xxxxx.xxxxxxx.xxxxx@xxxxxxx': xxxxxx xxxxx xxxxx xxxxxxxx xxxxx.\nxxxx.xxxxx.xxxxxxxxx: xxxxxxx xxxxxxxxxx xxxxxxxx xxxxxx.\n\tat xxxxxx.xxxxxxx.xxxx.xxxxx.xxxxxxx.xxxxx.xxxxxx(xxxxxxxx.java:354) ~[xxxxxx-xxxxxx-xxxx-1.1.1.jar:na]\n\tat xxxxxx.xxxxxxx.xxxx.xxxxx.xxxxxxx.xxxxx.xxxxxxxx(xxxxxxxx.java:210) [xxxx.xxxx.xxxx.xxxxx-1.1.1.jar:na]\n\tat xxxxxx.xxxxxxx.xxxx.xxxxx.xxxxxxx.xxxxx.xxxxxxxx(xxxxxxxxxxxxxx.java:72) [xxxx.xxxxxxxxxx.xxxxxx.xxxxxx-1.1.1.jar:na]\n\tat xxxx.xxxxxx.xxxxxxx.xxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxx(xxxxxxxxxxxxxx.java:66) [xxx.xxxxxxx.xxxx.xxxxxx-1.1.1.jar:na]\n\tat sun.xxxxxxx.xxxxxxxxx.xxxxx(Unknown Source) ~[na:na]\n\tat sun.xxxxx.xxxxxxxxxxx.xxxxx(xxxxxxxxxxxxxx.java:43) ~[na:1.1.1_17]\n\tat xxxx.xxxx.xxxxx.xxxx.xxxxx(xxxxx.java:601) ~[na:1.1.1_17]\n\tat xxxx.xxxxx.xxxx.xxxxx.xxxxx(xxxxxx.java:273) [xxxx.xxxxxxxx.xxxx-1.1.1.RELEASE.jar:1.1.1.RELEASE]\n\tat xxx.xxxxxxxxxx.xxxxxxxx.xxxxx.xxxxxxxxxxxxxxx$xxxxxxxxxxxxxx.xxxxxxxxx(xxxxxxxxxxxxxxxx.java:264) [xxx.xxxxxxxxxxxxxxxx.xxxxxxxx.xxxxx-1.1.1.RELEASE.jar:1.1.1.RELEASE]\n\tat xxxxxx.xxxxxxxxxxx.xxxxxxx.xxxxxxx.xxxxxxxxx.xxxxxx(xxxxxxxx.java:86) [xxxxxx.xxxxxx.xxxxxx.xxxx-1.1.1.RELEASE.jar:1.1.1.RELEASE]\n\tat xxx.xxxxxx.xxxx.xxxxxx.xxxx(xxxxxx.java:202) [xxxxxxx-1.1.1.jar:1.1.1]\n\tat xxxx.xxxxxx.xxxx.xxxxxxxxxxx$xxxxxxx.xxx(xxxxxx.java:529) [xxxx-1.1.1.jar:1.1.1]","@type":"xxxxx_log-type","reported":"yes"}}
---
No mappings defined
---
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 Friday, April 5, 2013 1:58:05 PM UTC-4, clive.w...@chloeandisabel.com
wrote:
Hi Jelle,
I'm having the same issue. Were you able to find a solution or workaround
for this?
Thanks,
Clive
On Thursday, September 27, 2012 5:45:46 AM UTC-4, Jelle Smet wrote:
Hi list,
My goal is to update an array which name starts with an @ sign.
For this I use the _update API by executing an mvel script. It seems to
work fine on elements which have a regular name.
I'm running version 0.19.9
See following output:
curl -XGET 'http://xxx:9200/_cluster/health?pretty=true '
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 85,
"active_shards" : 85,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 85
}
This works:
curl -XPUT xxx:9200/test/test/1 -d '{"counter" : 1, "tags" : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/1/_update' -d '{"script" : "ctx._source.tags += tag","params": {"tag":"fubar2"}}'
This does not work:
curl -XPUT xxx:9200/test/test/2 -d '{"counter" : 1, "@tags " : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/2/_update' -d '{"script" : "ctx._source.@tags += tag","params": {"tag":"fubar2"}}'
{"error":"ElasticSearchIllegalArgumentException[failed to execute script]; nested: ArrayIndexOutOfBoundsException[0]; ","status":400}
--
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 .
I'm very sorry to hijack an unrelated thread, but does anyone know why
google groups just deleted my new post on my SearchParseException? It
certainly didn't have anything objectionable or spammy in it.
-Brian
On Friday, April 5, 2013 12:18:30 PM UTC-6, Igor Motov wrote:
See
API Update Tags Problem · Issue #2852 · elastic/elasticsearch · GitHub
On Friday, April 5, 2013 1:58:05 PM UTC-4, clive.w...@chloeandisabel.comwrote :
Hi Jelle,
I'm having the same issue. Were you able to find a solution or
workaround for this?
Thanks,
Clive
On Thursday, September 27, 2012 5:45:46 AM UTC-4, Jelle Smet wrote:
Hi list,
My goal is to update an array which name starts with an @ sign.
For this I use the _update API by executing an mvel script. It seems to
work fine on elements which have a regular name.
I'm running version 0.19.9
See following output:
curl -XGET 'http://xxx:9200/_cluster/health?pretty=true '
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 85,
"active_shards" : 85,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 85
}
This works:
curl -XPUT xxx:9200/test/test/1 -d '{"counter" : 1, "tags" : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/1/_update' -d '{"script" : "ctx._source.tags += tag","params": {"tag":"fubar2"}}'
This does not work:
curl -XPUT xxx:9200/test/test/2 -d '{"counter" : 1, "@tags " : ["fubar1"]}'
curl -XPOST 'xxx:9200/test/test/2/_update' -d '{"script" : "ctx._source.@tags += tag","params": {"tag":"fubar2"}}'
{"error":"ElasticSearchIllegalArgumentException[failed to execute script]; nested: ArrayIndexOutOfBoundsException[0]; ","status":400}
--
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 .