updateMapping #
Updates a collection mapping.
Available since 1.7.1
You can define the collection dynamic mapping policy by setting the dynamic
field to the desired value.
You can define collection additional metadata within the _meta
root field.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/<index>/<collection>/_mapping
Method: PUT
Body:
{
"dynamic": "[true|false|strict]",
"_meta": {
"field": "value"
},
"properties": {
"field1": {
"type": "integer"
},
"field2": {
"type": "keyword"
},
"field3": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
}
Other protocols #
{
"index": "<index>",
"collection": "<collection>",
"controller": "collection",
"action": "updateMapping",
"body": {
"dynamic": "[true|false|strict]",
"_meta": {
"field": "value"
},
"properties": {
"field1": {
"type": "integer"
},
"field2": {
"type": "keyword"
},
"field3": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
}
}
Arguments #
collection
: collection nameindex
: index name
Body properties #
dynamic
: dynamic mapping policy for new fields. Allowed values:true
(default),false
,strict
_meta
: collection additional metadata stored next to the collectionproperties
: object describing the data mapping to associate to the new collection, using Elasticsearch types definitions format
Response #
{
"status": 200,
"error": null,
"index": "<index>",
"collection": "<collection>",
"action": "updateMapping",
"controller": "collection",
"requestId": "<unique request identifier>",
"result": {}
}
Possible errors #
Edit this page on Github(opens new window)