Created
August 3, 2012 10:21
-
-
Save chrisalexander/3246473 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Script for doing an update - works if "test" object is already in the index, but not if it does not. | |
curl -XPOST localhost:9200/00000000-0000-0000-0000-000000000000/tag/test/_update -d '{ "script": "ctx._source.count += 1" }' | |
Workaround - create an object if it doesn't exist then do the update, every time: | |
curl -XPOST localhost:9200/00000000-0000-0000-0000-000000000000/tag/test/?op_type=create -d '{"count":0}' | |
curl -XPOST localhost:9200/00000000-0000-0000-0000-000000000000/tag/test/_update -d '{ "script": "ctx._source.count += 1" }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment