1
以前我是用ES 1.5 ElasticSearch2.0映射,所以我可以很容易地創建數百個層次結構映射如下:如何快速創建數百場
{
"mapping": {
"country.*.population": {
"type": "int"
}
}
}
這意味着有父母提起國家在上百個國家類型爲int。
由於ES2.0不支持字段名稱中的點,所以在創建映射時我必須寫入百次映射。例如:
{
"country": {
"properties": {
"usa": {
"properties": {
"population": {
"type": "int"
}
}
},
"canada": {
"properties": {
"population": {
"type": "int"
}
}
}
}
}
}
對此有任何想法嗎?
哦,太累了,甚至忘了我用過:-)解決方案 – Jack