[[reference-indices-put_mapping]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
[[client.indices.putMapping]]
=== client.indices.putMapping

Update field mappings. Adds new fields to an existing data stream or index. You can also use this API to change the search settings of existing fields. For data streams, these changes are applied to all backing indices by default.

{ref}/indices-put-mapping.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(IndicesPutMappingRequest, options?): Promise<IndicesPutMappingResponse>
----

[discrete]
==== Request

[pass]
++++
<pre>
++++
interface IndicesPutMappingRequest extends <<RequestBase>> {
  index: <<Indices>>
  allow_no_indices?: boolean
  expand_wildcards?: <<ExpandWildcards>>
  ignore_unavailable?: boolean
  master_timeout?: <<Duration>>
  timeout?: <<Duration>>
  write_index_only?: boolean
  date_detection?: boolean
  dynamic?: <<MappingDynamicMapping>>
  dynamic_date_formats?: string[]
  dynamic_templates?: Record<string, <<MappingDynamicTemplate>>> | Record<string, <<MappingDynamicTemplate>>>[]
  _field_names?: <<MappingFieldNamesField>>
  _meta?: <<Metadata>>
  numeric_detection?: boolean
  properties?: Record<<<PropertyName>>, <<MappingProperty>>>
  _routing?: <<MappingRoutingField>>
  _source?: <<MappingSourceField>>
  runtime?: <<MappingRuntimeFields>>
}

[pass]
++++
</pre>
++++
[discrete]
==== Response

[pass]
++++
<pre>
++++
type IndicesPutMappingResponse = <<IndicesResponseBase>>

[pass]
++++
</pre>
++++
