I am attempting to apply a default _ttl
to all types in an index, without knowing the various types in advance.
The docs show plenty of examples where a mapping is given for a specific type. But there is no indication of how to
curl -XPUT http://localhost:9200/testing23feb12 -d '{
"settings": {
"number_of_shards":1
},
"mapping": {
"_all": {
"_ttl":{"enabled":true}
}
}
}'
{"ok":true,"acknowledged":true}
Didn't seem to work:
[2012-02-23 09:34:15,939][INFO ][cluster.metadata ] [Brothers Grimm] [testing23feb12] creating index, cause [api], shards [1]/[1], mappings []
curl -XPUT http://localhost:9200/testing23feb12-2 -d '{
"settings": {
"number_of_shards":1
},
"mapping": {
"_default_": {
"_ttl":{"enabled":true}
}
}
}'
Didn't work:
[2012-02-23 09:40:32,051][INFO ][cluster.metadata ] [Brothers Grimm] [testing23feb12-2] creating index, cause [api], shards [1]/[1], mappings []
clintongormley> mapping should be plural
curl -XPUT http://localhost:9200/testing23feb12-3 -d '{
"settings": {
"number_of_shards":1
},
"mappings": {
"_default_": {
"_ttl":{"enabled":true}
}
}
}'
Victory:
[2012-02-23 09:44:27,393][INFO ][cluster.metadata ] [Brothers Grimm] [testing23feb12-3] creating index, cause [api], shards [1]/[1], mappings [_default_]