What is mapping type in index template?

Hi,

I am using Elaasticsearch GA 5.0.0. I am tring to apply index template, and from this link I was able to get a tutorial with examples. Below is the sample template defined there.

PUT _template/template_1
{
  "template": "te*",
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "type1": {
      "_source": {
        "enabled": false
      },
      "properties": {
        "host_name": {
          "type": "keyword"
        },
        "created_at": {
          "type": "date",
          "format": "EEE MMM dd HH:mm:ss Z YYYY"
        }
      }
    }
  }
}

I would like to know what type1 defined there. Is this something like a name for grouping or has some relation with the index? Can I give it any name?

Thanks.

When you index a document you do:

PUT index/type/id 

So type is part of the document coordinates.

But starting from 6.0, you can use only one type per index.
And types are going to be removed in 7.0/8.0

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.