Skip to content

Commit

Permalink
Merge pull request aparo#428 from ubergrape/master
Browse files Browse the repository at this point in the history
Add ignore_conflicts parameter to put_mapping
  • Loading branch information
aparo committed Jul 28, 2014
2 parents 69ace41 + 9cfc31a commit 981b6c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyes/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def gateway_snapshot(self, indices=None):
path = self.conn._make_path(indices, (), '_gateway', 'snapshot')
return self.conn._send_request('POST', path)

def put_mapping(self, doc_type=None, mapping=None, indices=None):
def put_mapping(self, doc_type=None, mapping=None, indices=None, ignore_conflicts=None):
"""
Register specific mapping definition for a specific type against one or more indices.
(See :ref:`es-guide-reference-api-admin-indices-put-mapping`)
Expand All @@ -422,7 +422,12 @@ def put_mapping(self, doc_type=None, mapping=None, indices=None):
else:
path = self.conn._make_path(indices, (), "_mapping")

return self.conn._send_request('PUT', path, mapping)
parameters = {}

if ignore_conflicts is not None:
parameters['ignore_conflicts'] = ignore_conflicts

return self.conn._send_request('PUT', path, mapping, params=parameters)

def get_mapping(self, doc_type=None, indices=None, raw=False):
"""
Expand Down

0 comments on commit 981b6c7

Please sign in to comment.