Reputation: 481
I create an index template affecting all indices matching "shoppers-*" but then, when creating an index of this name format, the template is not applied, the mapping is not retrieved.
PUT /_index_template/my-template
{
"index_patterns": [
"shoppers-*"
],
"template": {
"mappings": {
"properties": {
"shopper": {
"properties": {
"tag": {
"type": "keyword"
}
}
}
}
},
"aliases": {
"my-template-alias": {}
}
}
}
{
"acknowledged": true
}
PUT /shoppers-0001
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "shoppers-0001"
}
POST /shoppers-0001/_refresh
{
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
}
}
GET /shoppers-0001/_mapping
{
"shoppers-0001": {
"mappings": {}
}
}
I cannot figure what could prevent the template to be applied to this index... Any things I may check to help debug this?
Upvotes: 0
Views: 522
Reputation: 481
Writing the problem after so many hours looking for an answer took me to the solution ! I am answering my own question for those who are going to read this question later with the same problem.
There were another template matching pattern *
and having precedence over my template !
Upvotes: 1