Skip to content

Instantly share code, notes, and snippets.

@sfussenegger
Created May 10, 2012 08:42
Show Gist options
  • Save sfussenegger/2651930 to your computer and use it in GitHub Desktop.
Save sfussenegger/2651930 to your computer and use it in GitHub Desktop.
Elasticsearch object mapping creating an aggregated index with the object's name
{
"city" : {
"properties" : {
"country" : {
"properties" : {
"code" : {
"type" : "multi_field",
"path" : "just_name",
"fields" : {
"code" : {
"type" : "string",
"index_name" : "country.code"
},
"country" : {
"type" : "string",
"include_in_all" : false
}
}
},
"name" : {
"type" : "multi_field",
"path" : "just_name",
"fields" : {
"name" : {
"type" : "string",
"index_name" : "country.name"
},
"country" : {
"type" : "string",
"include_in_all" : false
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment