Last active
December 16, 2015 15:19
-
-
Save webmasterkai/5455394 to your computer and use it in GitHub Desktop.
clicking the "add" or "remove" button to a cape item
This file contains hidden or 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
{"add": { | |
"script": "\tif(ctx._source.containsKey('cape_io')) {\n\t\tctx._source.cape_io.added += add;\n\t}\n\telse {\n\t\tctx._source.cape_io = upsert;\n\t\tctx._source.cape_io.added += add;\n\t}\n\t", | |
"params": { | |
"add": { | |
"query": "jobs_northmpls", | |
"removed": 1366835680, | |
"user": "northmpls.org" | |
}, | |
"upsert": { | |
"removed": [], | |
"added": [] | |
} | |
} | |
}, | |
"remove": { | |
"script": "\tif(ctx._source.containsKey('cape_io')) {\n\t\tctx._source.cape_io.removed += remove;\n\t}\n\telse {\n\t\tctx._source.cape_io = upsert;\n\t\tctx._source.cape_io.removed += remove;\n\t}\n\t", | |
"params": { | |
"remove": { | |
"query": "jobs_northmpls", | |
"removed": 1366835680, | |
"user": "northmpls.org" | |
}, | |
"upsert": { | |
"removed": [], | |
"added": [] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment