问题在于,在elasticsearch
输出中您为索引命名,base_map_simple
而在模板中该template
属性为base_map_template
,因此在创建新索引时不会应用该模板。该template
属性需要以某种方式匹配要创建的索引的名称,以使模板生效。
如果将后者简单地更改为,它将起作用base_map_*
,例如:
{
"template": "base_map_*", <--- change this
"order": 1,
"settings": {
"index.number_of_shards": 1
},
"mappings": {
"node_points": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
确保首先删除当前索引以及模板。
curl -XDELETE localhost:9200/base_map_simple
curl -XDELETE localhost:9200/_template/logstash