Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

getMapping #

Returns a collection mapping.

Available since 1.7.1

Also returns the collection dynamic mapping policy and collection additional metadata.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/<index>/<collection>/_mapping Method: GET

Other protocols #

{  "index": "<index>",  "collection": "<collection>",  "controller": "collection",  "action": "getMapping" }

Arguments #

  • collection: collection name
  • index: index name

Response #

Returns a mapping object with the following structure:

<index>  |- mappings  |- <collection>  |- dynamic  |- _meta  |- metadata 1  |- metadata 1  |- properties  |- mapping for field 1  |- mapping for field 2  |- ...  |- mapping for field n

Example: #

{  "status": 200,  "error": null,  "index": "<index>",  "collection": "<collection>",  "controller": "collection",  "action": "getMapping",  "requestId": "<unique request identifier>",  "result": {  "<index>": {  "mappings": {  "<collection>": {  "dynamic": "true",  "_meta": {  "metadata1": "value1"  },  "properties": {  "field1": { "type": "integer" },  "field2": { "type": "keyword" },  "field3": {  "type": "date",  "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"  }  }  }  }  }  } }

Possible errors #