Core
API v2.x
2

getMapping #

Returns a collection mapping.

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


Query Syntax #

HTTP #

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

Other protocols #

Copied to clipboard!
{
  "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:

Copied to clipboard!
|- dynamic
|- _meta
  |- metadata 1
  |- metadata 1
|- properties
  |- mapping for field 1
  |- mapping for field 2
  |- ...
  |- mapping for field n

Example: #

Copied to clipboard!
{
  "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 #