The PUT mapping API allows you to add fields to an existing index or to change search only settings of existing fields.
Creates an index called
Uses the PUT mapping API to add a new field called
More information on how to define mappings can be found in the mapping section.
Before 7.0.0, the mappings definition used to include a type name. Although specifying types in requests is now deprecated, a type can still be provided if the request parameter include_type_name is set. For more details, please see Removal of mapping types.
The PUT mapping API can be applied to multiple indices with a single request.
For example, we can update the
twitter-2 mappings at the same time:
Note that the indices specified (
Updating field mappingsedit
In general, the mapping for existing fields cannot be updated. There are some exceptions to this rule. For instance:
Create an index with a
Each mapping parameter specifies whether or not its setting can be updated on an existing field.