update #
Updates a collection configuration.
Available since 2.1.0
You can update the collection mappings and settings.
The search index is automatically refreshed, so you can perform a document:search on new properties right after.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/<index>/<collection> Method: POST Body:{ "mappings": { "dynamic": "[true|false|strict]", // boolean are also accepted "_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" } } }, "reindexCollection": true|false, "settings": { "analysis" : { "analyzer":{ "content":{ "type":"custom", "tokenizer":"whitespace" } } } } }Other protocols #
{ "index": "<index>", "collection": "<collection>", "controller": "collection", "action": "update", "body": { "mappings": { "dynamic": "[true|false|strict]", // boolean are also accepted "_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" } } }, "reindexCollection": true|false, "settings": { "analysis" : { "analyzer":{ "content":{ "type":"custom", "tokenizer":"whitespace" } } } } } }Arguments #
collection: collection nameindex: index name
Body properties #
settings: Elasticsearch index settingsmappings: collection mappingsreindexCollection: boolean, iftrue, the collection will be reindexed after the update
Available since 2.33.0
Response #
{ "status": 200, "error": null, "index": "<index>", "collection": "<collection>", "action": "update", "controller": "collection", "requestId": "<unique request identifier>", "result": null }