update #
Updates a collection configuration.
Available since 2.1.0
You can update the collection mappings and settings (opens new window).
While updating the collection settings (opens new window), the collection will be closed (opens new window) until the new configuration has been applied.
The search index is automatically refreshed, so you can perform a document:search
on new properties (opens new window) 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"
}
}
},
"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"
}
}
},
"settings": {
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}
}
}
Arguments #
collection
: collection nameindex
: index name
Body properties #
settings
: Elasticsearch index settings (opens new window)mappings
: collection mappings
Response #
{
"status": 200,
"error": null,
"index": "<index>",
"collection": "<collection>",
"action": "update",
"controller": "collection",
"requestId": "<unique request identifier>",
"result": null
}
Possible errors #
Edit this page on Github (opens new window)