答案 0 :(得分:0)
您使用的是哪个版本的ES?如果它小于5.0,那么您可以使用以下映射为每个文档生成时间戳:
curl -XPOST localhost:9200/test -d '{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"_default_":{
"_timestamp" : {
"enabled" : true,
"store" : true
}
}
}
}'
但是在较新版本的ES中删除了这一点,即在v5.0之后。 但他们提供了其他选项,如管道摄取。