Sorry, I don't get it ;)
Even when I set the version_type to external I also need to pass a version 
number greater the current doc version or my update will fail, right?

Index:
curl -XPUT 
'http://localhost:9200/videos/video/1?version_type=external&version=100' -d 
'{
    "name": "My video",
    "viewCounter": 0
}'

Update/Increment the viewCounter: I need to pass (minimum) 101, otherwise 
updating will fail ('m using current master to support version params on 
_update, see https://github.com/elasticsearch/elasticsearch/issues/3684)
curl -XPOST 
'localhost:9200/videos/video/1/_update?version_type=external&version=101' 
-d '{
    "script" : "ctx._source.viewCounter += 1"
}'

So it is not possible to increment the viewCounter without changing the 
version number either internal or external. One solution would be to copy 
the doc and reindex like Brian suggested above? 
Therefore I thought it would be nice to pass a parameter to _update to tell 
ES to not change the version number...

Thanks four your help!

-- 
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/df637087-4c49-49e9-b1c5-1731843b9295%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to