Skip to content

Instantly share code, notes, and snippets.

@ruflin
Last active March 17, 2016 15:27
Show Gist options
  • Save ruflin/a39df26ea823a74713dd to your computer and use it in GitHub Desktop.
Save ruflin/a39df26ea823a74713dd to your computer and use it in GitHub Desktop.
Dynamic mapping for name nested docs
{
"fs": {
"disk1": {
"size": 175,
"name": "dis1"
},
"disk2": {
"size": 1785,
"name": "dis2"
}
}
}
}
PUT my_index
{
"mappings": {
"my_type": {
"dynamic_templates": [
{
"disk_size": {
"path_match": "fs.*.size",
"mapping": {
"type": "string",
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment