def partial_update(self, index, doc_type, id, doc=None, script=None, params=None,<EOL>upsert=None, querystring_args=None):
if querystring_args is None:<EOL><INDENT>querystring_args = {}<EOL><DEDENT>if doc is None and script is None:<EOL><INDENT>raise InvalidQuery("<STR_LIT>")<EOL><DEDENT>if doc is None:<EOL><INDENT>cmd = {"<STR_LIT>": script}<EOL>if params:<EOL><INDENT>cmd["<STR_LIT>"] = params<EOL><DEDENT>if upsert:<EOL><INDENT>cmd["<STR_LIT>"] = upsert<EOL><DEDENT><DEDENT>else:<EOL><INDENT>cmd = {"<STR_LIT>": doc }<EOL><DEDENT>path = make_path(index, doc_type, id, "<STR_LIT>")<EOL>return self._send_request('<STR_LIT:POST>', path, cmd, querystring_args)<EOL>
Partially update a document with a script