Skip to content

Instantly share code, notes, and snippets.

@seallison
Last active December 31, 2015 19:09
Show Gist options
  • Save seallison/8031640 to your computer and use it in GitHub Desktop.
Save seallison/8031640 to your computer and use it in GitHub Desktop.
Template mapping differences between 0.90.7 and 0.90.8
# This template_testlocations.json resides in the 'config/templates' directory.
{
"template_testlocations": {
"template": "locations*",
"mappings": {
"locations": {
"_source": {
"compress": true
},
"_all": {
"enabled": false
},
"properties": {
"contactPersonId" : {
"index_analyzer": "keyword",
"type" : "string"
},
"state": {
"index_analyzer": "keyword",
"type": "string"
}
}
}
}
}
}
# insert some data in the locations index that will match this template:
curl -XPUT 'localhost:9200/locations/locations/1' -d '{"contactPersonId": "abc123", "state": "ACTIVE"}'
# This is the mapping output in 0.90.8. The logs do NOT indicate that the mapping was picked up.
curl -XGET 'localhost:9200/locations/_mapping?pretty'
{
"locations" : {
"locations" : {
"properties" : {
"contactPersonId" : {
"type" : "string"
},
"state" : {
"type" : "string"
}
}
}
}
}
# This is the mapping output in 0.90.7. The logs also indicated that the mapping was picked up when the data was inserted.
curl -XGET 'localhost:9200/locations/_mapping?pretty'
{
"locations" : {
"locations" : {
"_all" : {
"enabled" : false
},
"_source" : {
"compress" : true
},
"properties" : {
"contactPersonId" : {
"type" : "string",
"index_analyzer" : "keyword"
},
"state" : {
"type" : "string",
"index_analyzer" : "keyword"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment