I found the problem, it should be json object

curl -XPOST http://localhost:9200/blog/article/1/_update -d 
'{"script":"ctx._source.counter 
+= 2"}'



On Friday, August 1, 2014 9:40:44 PM UTC+8, [email protected] wrote:
>
> I am using 0.90.13.
>
> $ curl -XGET http://localhost:9200/blog/article/1?pretty
>
> {
>
>   "_index" : "blog",
>
>   "_type" : "article",
>
>   "_id" : "1",
>
>   "_version" : 3,
>
>   "exists" : true, "_source" : {"title":"New version of Elasticsearch 
> released!","content":"new 
> content","tags":["announce","elasticsearch","release"],"counter":1}
>
> }
>
>
> curl -XPOST http://localhost:9200/blog/article/1/_update -d 
> '"script":"ctx._source.counter += 2"'
>
> {"error":"NullPointerException[null]","status":500}
>
>
> what's wrong?
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/a781a1ea-8f50-47d2-b2bb-83f0f9c656c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to