From 6c29fca1c8d26b073ded13af56cedb034a3ea3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Fri, 17 Jan 2014 23:26:28 +0100 Subject: [PATCH] index is not required for put_mapping any more --- elasticsearch/client/indices.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index ebda02aa..774bf514 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -206,13 +206,14 @@ class IndicesClient(NamespacedClient): return data @query_params('ignore_conflicts', 'timeout', 'master_timeout') - def put_mapping(self, index, doc_type, body, params=None): + def put_mapping(self, doc_type, body, index=None, params=None): """ Register specific mapping definition for a specific type. ``_ - :arg index: A comma-separated list of index names; use `_all` to - perform the operation on all indices + :arg index: A comma-separated list of index names the alias should + point to (supports wildcards); use `_all` or omit to perform the + operation on all indices. :arg doc_type: The name of the document type :arg body: The mapping definition :arg ignore_conflicts: Specify whether to ignore conflicts while @@ -220,7 +221,7 @@ class IndicesClient(NamespacedClient): :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout """ - _, data = self.transport.perform_request('PUT', _make_path(index, doc_type, '_mapping'), + _, data = self.transport.perform_request('PUT', _make_path(index, '_mapping', doc_type), params=params, body=body) return data