I'm seeing a strange issue with my index templates in elasticsearch where Elasticsearch is overwriting the index templates I have defined with it's default mappings. I have a index template for all of my rpt_* indicies. When i do a GET /_template I see.
{
"reporting_template_msghist":{
"order":0,
"template":"rpt_*",
"settings":{
},
"mappings":{
"msgHistory":{
"properties":{
"date":{
"format":"dateOptionalTime",
"type":"date"
},
"campaignId":{
"index":"not_analyzed",
"type":"string"
},
"venueId":{
"index":"not_analyzed",
"type":"string"
},
"state":{
"index":"not_analyzed",
"type":"string"
}
}
}
},
"aliases":{
}
}
}
I then create a new document (along with a new index) in the index rpt_201506 with body:
{
"campaignId": "abc-123-zxyz",
"date": "2015-01-23T19:28:07.000+0000",
"venueId": "venue_id",
"state": "read"
}
When I investigate the index mappings after the index and first document is created they are now:
"msgHistory":{
"properties":{
"date":{
"format":"dateOptionalTime",
"type":"date"
},
"campaignId":{
"type":"string"
},
"venueId":{
"type":"string"
},
"state":{
"type":"string"
}
}
}
Hopefully, I'm just doing something stupid, but I didn't expect Elasticsearch to try and dynamically determine the mapping since I already had the index template mapping defined.