Skip to content

Commit

Permalink
Merge pull request #6 from bra-fsn/master
Browse files Browse the repository at this point in the history
Allow usage of script_file
  • Loading branch information
lextoumbourou committed Jul 18, 2015
2 parents 3e9f555 + 7ab3619 commit 1bca725
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions txes2/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,15 +649,18 @@ def update_settings(self, index, settings):
return d

def partial_update(
self, index, doc_type, id, doc=None, script=None,
self, index, doc_type, id, doc=None, script=None, script_file=None,
params=None, upsert=None, **query_params
):
"""Partially update a document with a script."""
if doc is None and script is None:
if doc is None and script is None and script_file is None:
raise exceptions.InvalidQuery("script or doc can not both be None")

if doc is None:
cmd = {'script': script}
if script:
cmd = {'script': script}
elif script_file:
cmd = {'script_file': script_file}
if params:
cmd["params"] = params
if upsert:
Expand Down

0 comments on commit 1bca725

Please sign in to comment.