def put_mapping(self, doc_type=None, mapping=None, indices=None, ignore_conflicts=None):
if not isinstance(mapping, dict):<EOL><INDENT>if mapping is None:<EOL><INDENT>mapping = {}<EOL><DEDENT>if hasattr(mapping, "<STR_LIT>"):<EOL><INDENT>mapping = mapping.as_dict()<EOL><DEDENT><DEDENT>if doc_type:<EOL><INDENT>path = self.conn._make_path(indices, doc_type, "<STR_LIT>")<EOL>if doc_type not in mapping:<EOL><INDENT>mapping = {doc_type: mapping}<EOL><DEDENT><DEDENT>else:<EOL><INDENT>path = self.conn._make_path(indices, (), "<STR_LIT>")<EOL><DEDENT>parameters = {}<EOL>if ignore_conflicts is not None:<EOL><INDENT>parameters['<STR_LIT>'] = ignore_conflicts<EOL><DEDENT>return self.conn._send_request('<STR_LIT>', path, mapping, params=parameters)<EOL>
Register specific mapping definition for a specific type against one or more indices.
(See :ref:`es-guide-reference-api-admin-indices-put-mapping`)