Core
API v2.x
2

getMapping #

Returns a collection mapping.

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


Query Syntax #

HTTP #

URL: http://kuzzle:7512/<index>/<collection>/_mapping[?includeKuzzleMeta]
Method: GET

Other protocols #

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

Arguments #

  • collection: collection name
  • index: index name
  • includeKuzzleMeta: include Kuzzle metadata mappings in the response

Response #

Returns a mapping object with the following structure:

|- 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": {
    "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 #