Skip to content

Instantly share code, notes, and snippets.

@mikemilano
Last active June 5, 2019 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemilano/aab32b93ae843429bbd47825cda6fe72 to your computer and use it in GitHub Desktop.
Save mikemilano/aab32b93ae843429bbd47825cda6fe72 to your computer and use it in GitHub Desktop.
Elasticsearch index template example
By adding the following template to an Elasticsearch
instance, you will assure any index with a name
beginning with `enrollment-log` will inherit the
mappings defined within.
PUT _template/enrollment-log
{
"template": "enrollment-log*",
"settings": {
"number_of_shards": 4
},
"mappings": {
"doc": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"action": {
"type": "keyword"
},
"creator": {
"type": "keyword"
},
"districtId": {
"type": "integer"
},
"districtReviewer": {
"type": "keyword"
},
"enrollee": {
"type": "keyword"
},
"enrollmentId": {
"type": "integer"
},
"enrollmentType": {
"type": "keyword"
},
"timestamp": {
"type": "date"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment