I want to use index template when creating index in elasticsearch.
I saw that we can set _id field with specific field when creating index.
(https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-id-field.html)
Is it possible to set _id field when creating index template like this way?
For example, suppose that I want to set _id as "tag_seq" field when creating index template..
PUT _template/template_1
{
"index_patterns": ["te*", "bar*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"_source": {
"enabled": false
},
"properties": {
"host_name": {
"type": "keyword"
},
"tag_seq" : {
"type" : "integer"
},
"created_at": {
"type": "date",
"format": "EEE MMM dd HH:mm:ss Z yyyy"
},
"_id" : {
"path" : "tag_seq",
"type" : "integer"
}
}
}
}
I tried to use the script above, but it gives me an error...