Skip to content

Instantly share code, notes, and snippets.

@ashokc
Created December 2, 2019 16:48
Show Gist options
  • Save ashokc/b025e02c30c32e1ac8739f3886b0b390 to your computer and use it in GitHub Desktop.
Save ashokc/b025e02c30c32e1ac8739f3886b0b390 to your computer and use it in GitHub Desktop.
def removeDeaths():
body = { "bool": { "must": [ { "match": { "HOSPITAL_EXPIRE_FLAG": 1 } }, { "match": { "readmit": 0 } } ] } }
update_by_query = { "script": { "source": "ctx._source.readmit=-1", "lang": "painless" }, "query": body}
client.update_by_query(index=index, body=update_by_query, timeout='2m')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment