Update return 500 and npe


(fancyerii) #1

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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b32bb63f-6097-438e-bfc7-1c2dfea22cbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(fancyerii) #2

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, fanc...@gmail.com 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 elasticsearch+unsubscribe@googlegroups.com.
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.


(system) #3